Solaris · LDOMs – Removing Domains & Virtual Services

Solaris SPARC · LDOMs · Cleanup

Removing LDOMs & Virtual Services

When a guest is no longer needed, you should remove it cleanly: shut down, detach virtual devices, delete the domain and clean up backend storage. This avoids orphaned configs and wasted space.

High-level removal steps

Order of operations

  • Stop and unbind domain.
  • Remove vdisks and vnets from domain.
  • Remove backend vdsdev from service domain.
  • Delete domain.
  • Destroy ZFS volumes if no longer needed.

Commands and example

1. Stop and unbind a guest domain

Before removal, halt and unbind the domain.

terminal — ldom cleanup
ldoms-lab
[root@primary ~]# ldm stop ldg1
[root@primary ~]# ldm unbind ldg1

2. Remove vdisks and vnets

Detach front-end devices from guest.

terminal — ldom cleanup
ldoms-lab
[root@primary ~]# ldm list -l ldg1 | egrep 'VDISK|VNET'
 
# Example:
[root@primary ~]# ldm remove-vdisk dvd0 ldg1
[root@primary ~]# ldm remove-vdisk vdisk0 ldg1
[root@primary ~]# ldm remove-vnet vnet0 ldg1

3. Delete the guest domain

Once devices removed, delete the domain definition.

terminal — ldom cleanup
ldoms-lab
[root@primary ~]# ldm remove-domain ldg1

4. Remove backend vdsdev and ZFS volumes

Clean up backend resources on service domain.

terminal — ldom cleanup
ldoms-lab
# Remove backend device from vds
[root@primary ~]# ldm remove-vdsdev ldg1-root@primary-vds0
 
# Destroy ZFS volume
[root@primary ~]# zfs destroy rpool/ldoms/ldg1-root

Be careful before deleting

  • Take backups or snapshots if there is any chance of reuse.
  • Double-check domain name; do not remove the wrong guest.
  • Verify no other domains use the same backend ZFS volume.