How to Remove LDOM

How to Remove LDOM

RSY Digital World Logo

How to Remove LDOM

We are going to discuss how to remove ldom in this post. In this post, we will illustrate the necessary steps about how to remove ldom in Solaris. First, we will discuss a few basics related to how to delete ldom completely. We are considering here how to decommission ldom.

We are discussing how to delete ldom completely here so we must be having ldom name which is expected to be removed. So let’s see how to find cdom from ldom.

How to find cdom from ldom?

Login to ldom with elevated privilege which you have the plan to remove. virtinfo command can be used to resolve how to find cdom from ldom query. Sample output to refer is as below where you can see ldom name as well as cdom name which is hosting ldom you are planning to remove.

# virtinfo -a
Domain role: LDoms guest
Domain name: ldom01
Domain UUID: 373c6a3c-2400-44aa-ac1c-9b123456b63
Control domain: sol10dom01
Chassis serial#: CK00291861

So now we have ldom name as well as cdom name. Login to cdom using putty and take system admin privilege. Let’s look at the process of how to check ldoms in solaris 10 or 11.

How to check ldoms in Solaris?

You need to have elevated privilege to run ldm ls or ldm list command. Both can be used to get same information.You can use any which you like as both will serve same information ie it is resolving question how to check ldoms in solaris.

# ldm list
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  NORM  UPTIME
primary          active     -n-cv-  UART    16    49G      1.9%  1.9%  13d 2h 30m
ldom01         active     -n----  5005    24    46G      1.1%  1.1%  13d 2h 7m
ldom02         active     -n----  5006    24    86G      3.3%  3.3%  13d 4h
ldom03       active     -n----  5000    40    42G      1.0%  1.0%  13d 4h
ldom04       active     -n----  5013    24    40G      2.9%  2.9%  12d 23h 54m
ldom05       active     -n----  5010    8     16G      0.5%  0.5%  12d 23h 45m
# ldm ls
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  NORM  UPTIME
primary          active     -n-cv-  UART    16    49G      1.9%  1.9%  13d 2h 30m
ldom01         active     -n----  5005    24    46G      1.1%  1.1%  13d 2h 7m
ldom02         active     -n----  5006    24    86G      3.3%  3.3%  13d 4h
ldom03       active     -n----  5000    40    42G      1.0%  1.0%  13d 4h
ldom04       active     -n----  5013    24    40G      2.9%  2.9%  12d 23h 54m
ldom05       active     -n----  5010    8     16G      0.5%  0.5%  12d 23h 45m

First of all, you need to login to Control Domain where your ldom is configured means cdom which is hosting ldom in question. You can refer above how to find cdom from ldom and how to check ldoms in solaris.

So you have all the details now. how to remove ldom will have below high-level steps. Usually, it should be something reverting all the configuration which was done during creating ldom.

  1. Shutdown LDOM
  2. Stop LDOM
  3. Unbind LDOM
  4. Remove LDOM
  5. Remove vdsdev/vdisk in LDOM
  6. Remove vnet from LDOM

So let’s go forward with the steps mentioned above which will be able to address many queries during the process like below.

How to Shutdown LDOM?

We recommend logging in to the console of LDOM instead of directly stopping LDOM.

1. Login to cdom via Putty and take the necessary sudo.
2. How to List ldoms?
# ldm ls
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  NORM  UPTIME
primary          active     -n-cv-  UART    16    49G      1.9%  1.9%  13d 2h 30m
ldom01         active     -n----  5005    24    46G      1.1%  1.1%  13d 2h 7m
ldom02         active     -n----  5006    24    86G      3.3%  3.3%  13d 4h
ldom03       active     -n----  5000    40    42G      1.0%  1.0%  13d 4h
ldom04       active     -n----  5013    24    40G      2.9%  2.9%  12d 23h 54m
ldom05       active     -n----  5010    8     16G      0.5%  0.5%  12d 23h 45m

How to Login to LDOM Console?

There is two way how to login to ldom console. You can use either form from ldm ls output. We are going to use an assigned port in both cases.

Syntax is like below

# telnet <localhost>  <Port>
# telnet 0 <Port>
Sample output is below
# telnet 0 5000
Trying 0.0.0.0...
Connected to 0.
Escape character is '^]'.
Connecting to console "ldom01" in group "ldom01" ....
Press ~? for control options ..
--------------------------------
--------------------------------               
ldom01 console login: 
Provide credentials and take required Sudo and run below command.
# shutdown -y -g0 -i0
OR
# init 0
# svc.startd: The system is coming down.  Please wait.
svc.startd: 89 system services are now being stopped.
svc.startd: The system is down.
syncing file systems... done
Program terminated
NOTICE: Entering OpenBoot.
NOTICE: Fetching Guest MD from HV.
NOTICE: Starting additional cpus.
NOTICE: Initializing LDC services.
NOTICE: Probing PCI devices.
NOTICE: Finished PCI probing.
SPARC T5-2, No Keyboard
Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
OpenBoot 4.36.2, 32.0000 GB memory available, Serial #12345678.
Ethernet address 0:94:9f:fb:4d:e7, Host ID: 123abc34.
{0} OK
Return to the primary domain:
{0} OK “Escape character is '^]'”
telnet> quit
Connection to 0 closed.

Same thing especially shutting down ldom you can also do via directly logging to ldom itself. Console steps are shown for visibility and the best option to shutdown in a proper manner. Now you can safely proceed with Stopping, Unbinding, and Remove from.

How to stop LDOM in Solaris?

Simply take ldom status and stop it using ldm stop-domain or ldm stop command. Once you stop the ldom it will have bound state from active state.

Please refer to the below output.

# ldm ls
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  NORM  UPTIME
primary          active     -n-cv-  UART    16    32G      0.6%  0.6%  3h 8m
ldom01          active     -n----  5000    8     32G      2.4%  2.4%  3m
# ldm stop-domain ldom01
Remote graceful shutdown or reboot capability is not available on ldom01
LDom ldom01 stopped
# ldm ls
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  NORM  UPTIME
primary          active     -n-cv-  UART    16    32G      1.0%  1.0%  3h 10m
ldom01          bound      ------  5000    8     32G

How to unbind LDOM?

You can use ldm unbind to unbind the LDOM. ldm unbind is also really helpful if you have made
any configuration changes to LDOM and you want configuration changes to take effect.You can
simply do ldm unbind and ldm bind which forces LDOM to make the changes in effect.
Once you do ldm unbind ldom becomes inactive and if you do ldm bind again it goes to active 
state and incorporate all the changes done in inactive state. 
# ldm unbind-domain ldom01
# ldm ls
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  NORM  UPTIME
primary          active     -n-cv-  UART    16    32G      1.0%  0.8%  3h 11m
ldom01           inactive   ------          8     32G

How to Delete LDOM?

You need to make sure ldom is in inactive state. Please verify using ldm ls. You can delete ldom using ldm remove-domain command. Once you delete ldom it will disappear from ldm ls command display.

# ldm ls
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  NORM  UPTIME
primary          active     -n-cv-  UART    16    32G      1.0%  0.8%  3h 11m
ldom01           inactive   ------          8     32G
# ldm remove-domain ldom01
# ldm ls
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  NORM  UPTIME
primary          active     -n-cv-  UART    16    32G      0.4%  0.4%  3h 13m

How to remove vdsdev in LDOM?

For removing vdsdev you must need ldom to be stopped. If you have added new disk to ldom you might have done in order of adding vdsdev and then adding vdisk using ldm add-vdsdev and ldm add-vdisk.

You can refer how to add vdisk from cdom to ldom online.

So you have to remove vdsdev in reverse order. You can run what all disk is associated with ldom you are decommissioning like below and you can easily verify rootdisk and datadisk. Ultimately if you are decommissioning you need to remove all for either re-use or reclaim depends upon your scenario.

# ldm list -o disk ldom01        >> You can get list of devices associated to ldom.
# ldm stop ldom01
# ldm remove-vdisk -f usp0_0143-p1 ldom01
# ldm remove-vdsdev -f [email protected]
# ldm ls -o disk ldom01            >> Please verify that no more disk linked to ldom.

How to remove vnet from LDOM

Please take a list of vnet resources associated with the ldom. You can remove vnet configurations associated with ldom which is getting decommission.

# ldm ls -o net ldom01
NAME
ldom01
MAC
    00:79:9f:fa:94:e6
NETWORK
NAME         SERVICE                MACADDRESS          PVID|PVLAN|VIDs
     ----         -------                ----------          ---------------
vnet0        primary-vsw0           00:14:4f:fa:bf:d7   1|--|--
            DEVICE     :--              ID   :0
            LINKPROP   :phys-state      MTU  :--
            MAXBW      :--              MODE :--
            CUSTOM     :disable
            PRIORITY   :--              COS  :--
            PROTECTION :--
# ldm rm-vnet <interface-name> ldom
You can use –f switch in case if you need to forcibly remove vnet from ldom.
Finally you can run ldm ls –l command to validate if anything left related to ldom you are 
decommissioning, remove if any.
# ldm ls –l
This will have configuration details of all ldoms configured. So it will be long output. You can 
grep output to see anything related to your ldom left on which you are working.

How to Backup CDOM Configuration

It is advised to create a backup of CDOM configuration before and after any change. 
To display current available configiguration of Control Domain
# ldm list-config                                 OR                          # ldm list-spconfig
To create wew configuration backup of Control Domain
# ldm set-config <DATE>                  OR                         # ldm set-spconfig <DATE>

That`s it related to how to remove ldom, how to delete ldom in solaris, how to delete ldom, how to remove ldom configuration, or simply how to decommission ldom. I hope we have covered everything related to how to delete ldom completely. Let us know in the comment if something left out, will be glad to update.

Other LDOM CDOM Related Stuff

1.  Solaris 11 LDOM Recovery

2. Configuring IPMP in Oracle Solaris 11

3. Restoring Domain Configurations

 

RSY Digital World

RSY Digital World Founder & [email protected] Digital World. A UNIX Linux expert having a more than 20 years of experience in Solaris Red Hat Linux HP-UX AIX Unixware Open Server Veritas Storage Cloud Bigdata and many more in UNIX LINUX Infrastructure technologies.

Leave a Reply