In our previous article we went through the process of preparing a Solaris 11 for SPARC machine as a Logical Domain hypervisor. Now that we have laid out our foundation we are ready to create some Logical Domains.
Solaris Virtualization: Using Logical Domains on Solaris 11 Part One
Create the Logical Domain
root@t4:~# ldm add-domain t4-g1
Configure Devices
We will need to add devices to our newly created domain. Here we will add virtual CPUs, memory, and a network device.
root@t4:~# ldm add-vcpu 8 t4-g1 root@t4:~# ldm add-memory 4G t4-g1 root@t4:~# ldm add-vnet vnet1 primary-vsw0 t4-g1
Configure Storage Devices
Add the installation media to our domain using an iso image which we added to the Virtual Disk Service service which we created in Part One.
root@t4:~# ldm add-vdisk s11.iso solaris11_media@primary-vds0 t4-g1
Create a couple of ZFS volumes for use by the domain, we are using the -p option to create the parent file system with the name of the logical domain for organization.
root@t4:~# zfs create -p -V 20G rpool/ldoms/t4-g1/disk0 root@t4:~# zfs create -p -V 20G rpool/ldoms/t4-g1/disk1
Add the ZFS volumes to the Virtual Disk Server service (primary-vds0).
root@t4:~# ldm add-vdsdev /dev/zvol/dsk/rpool/ldoms/t4-g1/disk0 t4-g1-disk0@primary-vds0 root@t4:~# ldm add-vdsdev /dev/zvol/dsk/rpool/ldoms/t4-g1/disk1 t4-g1-disk1@primary-vds0
Configure our domain with our disk storage devices (disk0 and disk1) from the Virtual Disk Server service.
root@t4:~# ldm add-vdisk disk0 t4-g1-disk0@primary-vds0 t4-g1 root@t4:~# ldm add-vdisk disk1 t4-g1-disk1@primary-vds0 t4-g1
Configure Boot Devices
We want our domain to auto-boot and use disk0 as the primary boot device.
root@t4:~# ldm set-var auto-boot\?=true t4-g1 root@t4:~# ldm set-var boot-device=disk0 t4-g1
Set the Host ID
root@t4:~# ldm set-domain hostid=85e92821 t4-g1
Additionally the hostid option can be passed in the add-domain command when you originally create the domain.
Tomorrow we will go through the process of connecting to the console of the Logical Domain and then install an operating system.