Creating a base LDOM image
Now that the Control domain is setup, you can start creating LDOM's at will. The idea here is to create a base LDOM image that can be cloned to quickly provision new servers.
1. Create a ZFS file system to store the disk image for our LDOM
zfs create storage/base
This will create a ZFS file system called storage/base that will be mounted at /storage/base
2. Create a ZFS disk image to hold the LDOM's data
zfs create -V 36gb storage/base/disk0
This will create a 36Gb disk image. You can see the results in the zfs list output:
# zfs list NAME USED AVAIL REFER MOUNTPOINT storage 37.1G 630G 36.5K /storage storage/base 37.1G 630G 34.9K /storage/base storage/base/disk0 37.1G 667G 26.6K - .....
3. Create the new LDOM
ldm add-domain base
4. Assign virtual CPU's to the new LDOM
ldm add-vcpu 8 base
5. Assign memory to the new LDOM
ldm add-memory 2G base
6. Create a virtual disk device and assign it to the new LDOM
ldm add-vdsdev /dev/zvol/dsk/storage/base/disk0 base-vol1@primary-vds0 ldm add-vdisk vdisk1 base-vol1@primary-vds0 base
This creates a virtual disk device called base-vol1@primary-vds0 that is then assigned to the LDOM base. ldm list-services should now look like this:
7. Add a virtual network interface to the new LDOM
ldm add-vnet vnet1 primary-vsw0 base