Solaris · LDOMs – Creating Guest Domains

Solaris SPARC · LDOMs · Guest

Creating Guest Domains (LDOMs)

Guest domains are where your applications actually run. In this lesson you will create a simple guest LDOM: assign CPU, memory, virtual disks, virtual network and start the OS installation.

High-level steps to build a guest domain

1. Define domain

Create the domain entry (name) and assign CPU + memory.

2. Attach storage & network

Provide virtual disks and virtual NICs from the service/I/O domain.

3. Bind & install OS

Bind the domain, power it on, then install Solaris inside like a normal SPARC machine.

Planning tips

  • Decide CPU and memory sizing based on workload.
  • Plan ZFS layout for domain disks (root, data, logs, etc.).
  • Design IP and VLAN for vnets beforehand.

Commands and examples

1. Create a guest domain skeleton

ldm add-domain defines a new domain name.

terminal — guest domain
ldoms-lab
[root@primary ~]# ldm add-domain ldg1
 
[root@primary ~]# ldm list
NAME STATE FLAGS CONS VCPU MEMORY UTIL UPTIME
primary active -n-cv SP 8 32G 4% 3d
ldg1 inactive ------ 5000 0 0 0% 0s

2. Assign vCPUs and memory

ldm set-vcpu and ldm set-memory assign resources to the guest.

terminal — guest domain
ldoms-lab
[root@primary ~]# ldm set-vcpu 4 ldg1
[root@primary ~]# ldm set-memory 8G ldg1
 
[root@primary ~]# ldm list ldg1
NAME STATE FLAGS CONS VCPU MEMORY UTIL UPTIME
ldg1 inactive ------ 5000 4 8G 0% 0s

3. Provide a virtual disk (backed by ZFS volume or file)

Export a backend device from service domain and assign it as vdisk.

terminal — guest domain
ldoms-lab
# On service/primary domain:
[root@primary ~]# zfs create -V 50G rpool/ldoms/ldg1-root
 
# Add vdsdev (backend) to virtual disk service primary-vds0
[root@primary ~]# ldm add-vdsdev /dev/zvol/dsk/rpool/ldoms/ldg1-root ldg1-root@primary-vds0
 
# Add vdisk to guest
[root@primary ~]# ldm add-vdisk vdisk0 ldg1-root@primary-vds0 ldg1

4. Provide a virtual network interface

Create vsw on physical NIC, then add vnet to the guest.

terminal — guest domain
ldoms-lab
# Create virtual switch on net0 (one-time)
[root@primary ~]# ldm add-vsw net-dev=net0 primary-vsw0 primary
 
# Add vnet to guest
[root@primary ~]# ldm add-vnet vnet0 primary-vsw0 ldg1

5. Bind and start install (from ISO or network)

Bind finalizes the configuration; then start install (e.g. from virtual DVD).

terminal — guest domain
ldoms-lab
# Bind the domain
[root@primary ~]# ldm bind ldg1
 
# Start domain (for OS install)
[root@primary ~]# ldm start ldg1
 
# Connect to console
[root@primary ~]# telnet localhost 5000
# or using 'ldm console ldg1' on some versions
 
# Inside OBP, boot from network or virtual DVD to install Solaris.