Creating Default Services
The following virtual device services must be created to use the control domain as a service domain and to create virtual devices for other domains:
- vcc – Virtual console concentrator service
- vds – Virtual disk server
- vsw – Virtual switch service
How to Create Default Services
- Create a virtual console concentrator (vcc) service for use by the virtual network terminal server daemon (vntsd) and as a concentrator for all logical domain consoles.For example, the following command would add a virtual console concentrator service (primary-vcc0) with a port range from 5000 to 5100 to the control domain (primary).
primary# ldm add-vcc port-range=5000-5100 primary-vcc0 primary
- Create a virtual disk server (vds) to allow importing virtual disks into a logical domain.For example, the following command adds a virtual disk server (primary-vds0) to the control domain (primary).
primary# ldm add-vds primary-vds0 primary
- Create a virtual switch service (vsw) to enable networking between virtual network (vnet) devices in logical domains.Assign a GLDv3-compliant network adapter to the virtual switch if each logical domain must communicate outside the box through the virtual switch.Add a virtual switch service (primary-vsw0) on a network device that you want to use for guest domain networking.
primary# ldm add-vsw net-dev=network-device vsw-service primary
For example, the following command adds a virtual switch service (primary-vsw0) on network device net0 to the control domain (primary):
primary# ldm add-vsw net-dev=net0 primary-vsw0 primary
You can use the ldm list-netdev -b command to determine the backend network devices that are available for the virtual switch. See Virtual Switch.
You can dynamically update the net-dev property value by using the ldm set-vsw command.
- Verify the services have been created by using the list-services subcommand.Your output should look similar to the following:
primary# ldm list-services primary VDS NAME VOLUME OPTIONS DEVICE primary-vds0 VCC NAME PORT-RANGE primary-vcc0 5000-5100 VSW NAME MAC NET-DEV DEVICE MODE primary-vsw0 02:04:4f:fb:9f:0d net0 switch@0 prog,promisc
How to Configure the Control Domain
This procedure contains examples of resources to set for your control domain. These numbers are examples only, and the values used might not be appropriate for your control domain.
For domain sizing recommendations, see Oracle VM Server for SPARC Best Practices (http://www.oracle.com/technetwork/server-storage/vm/ovmsparc-best-practices-2334546.pdf).
- Assign virtual CPUs to the control domain.Service domains, including the control domain, require CPU and memory resources to perform virtual disk and virtual network I/O operations for guest domains. The amount of CPU and memory resources to allocate depends on the workload of the guest domain.For example, the following command assigns two CPU cores (16 virtual CPU threads) to the control domain, primary. The remainder of the virtual CPU threads are available for guest domains.
primary# ldm set-core 2 primary
You can dynamically change the actual CPU allocation based on application requirements. Use the ldm list command to determine the CPU utilization of the control domain. If the control domain has high CPU utilization, use the ldm add-core and ldm set-core commands to add CPU resources to a service domain.
- Determine whether you need cryptographic devices in the control domain.Note that only UltraSPARC T2, UltraSPARC T2 Plus, and SPARC T3 platforms have cryptographic devices (MAUs). Newer platforms such as SPARC T4 systems and Fujitsu M10 servers already provide cryptographic acceleration, so you do not need to assign cryptographic accelerators to these platforms.If you are using one of the older processors, assign one cryptographic unit for each CPU whole core in the control domain.
The following example assigns two cryptographic resources to the control domain, primary:
primary# ldm set-crypto 2 primary
- Initiate a delayed reconfiguration on the control domain.
primary# ldm start-reconf primary
- Assign memory to the control domain.For example, the following command assigns 16 Gbytes of memory to the control domain, primary. This setup leaves the remainder of the memory available to guest domains.
primary# ldm set-memory 16G primary
- Save the domain configuration to the service processor (SP).For example, the following command would add a configuration called initial.
primary# ldm add-config initial
- Verify that the configuration is ready to be used at the next reboot.
primary# ldm list-config factory-default initial [current]
This ldm list-config command shows that the initial configuration set will be used after you perform a power cycle.
- Reboot the control domain to make the reconfiguration changes take effect.
How to Reboot
- Shut down and reboot the control domain.
primary# shutdown -y -g0 -i6
How to Enable the Virtual Network Terminal Server Daemon
Note – Be sure that you have created the default service vconscon (vcc) on the control domain before you enable vntsd. See Creating Default Services for more information.
- Enable the virtual network terminal server daemon, vntsd.
primary# svcadm enable vntsd
- Verify that the vntsd daemon is enabled.
primary# svcs vntsd STATE STIME FMRI online Oct_08 svc:/ldoms/vntsd:default
How to Verify the ILOM Interconnect Configuration
- Verify that the ilomconfig-interconnect service is enabled.
primary# svcs ilomconfig-interconnect STATE STIME FMRI online 9:53:28 svc:/network/ilomconfig-interconnect:default
- Verify that the ILOM interconnect is configured properly.A proper configuration shows the State value as enabled and the Host Interconnect IP Address value as an IP address and not none.
primary# ilomconfig list interconnect Interconnect ============ State: enabled Type: USB Ethernet SP Interconnect IP Address: 169.254.182.76 Host Interconnect IP Address: 169.254.182.77 Interconnect Netmask: 255.255.255.0 SP Interconnect MAC Address: 02:21:28:57:47:16 Host Interconnect MAC Address: 02:21:28:57:47:17
- Verify that the ldmd daemon can communicate with the SP.
primary# ldm list-spconfig
How to Create and Start a Guest Domain
- Create a logical domain.The following command would create a guest domain named ldg1.
primary# ldm add-domain ldg1
- Add CPUs to the guest domain.Do one of the following:
- Add virtual CPUs.The following command would add eight virtual CPUs to guest domain ldg1.
primary# ldm add-vcpu 8 ldg1
- Add whole cores.The following command would add two whole cores to guest domain ldg1.
primary# ldm add-core 2 ldg1
- Add virtual CPUs.The following command would add eight virtual CPUs to guest domain ldg1.
- Add memory to the guest domain.The following command would add 2 gigabytes of memory to guest domain ldg1.
primary# ldm add-memory 2G ldg1
- Add a virtual network device to the guest domain.The following command would add a virtual network device with these specifics to the guest domain ldg1.
primary# ldm add-vnet vnet1 primary-vsw0 ldg1
Where:
- vnet1 is a unique interface name to the logical domain, assigned to this virtual network device instance for reference on subsequent set-vnet or remove-vnet subcommands.
- primary-vsw0 is the name of an existing network service (virtual switch) to which to connect.
Note – Steps 5 and 6 are simplified instructions for adding a virtual disk server device (vdsdev) to the primary domain and a virtual disk (vdisk) to the guest domain. To learn how ZFS volumes and file systems can be used as virtual disks, see How to Export a ZFS Volume as a Single-Slice Disk and Using ZFS With Virtual Disks.
- Specify the device to be exported by the virtual disk server as a virtual disk to the guest domain.You can export a physical disk, disk slice, volumes, or file as a block device. The following examples show a physical disk and a file.
- Physical Disk Example. This example adds a physical disk with these specifics:
primary# ldm add-vdsdev /dev/dsk/c2t1d0s2 vol1@primary-vds0
Where:
- /dev/dsk/c2t1d0s2 is the path name of the actual physical device. When adding a device, the path name must be paired with the device name.
- vol1 is a unique name you must specify for the device being added to the virtual disk server. The volume name must be unique to this virtual disk server instance because this name is exported by this virtual disk server to the clients for adding. When adding a device, the volume name must be paired with the path name of the actual device.
- primary-vds0 is the name of the virtual disk server to which to add this device.
- File Example. This example exports a file as a block device.
primary# ldm add-vdsdev backend vol1@primary-vds0
Where:
- backend is the path name of the actual file exported as a block device. When adding a device, the back end must be paired with the device name.
- vol1 is a unique name you must specify for the device being added to the virtual disk server. The volume name must be unique to this virtual disk server instance because this name is exported by this virtual disk server to the clients for adding. When adding a device, the volume name must be paired with the path name of the actual device.
- primary-vds0 is the name of the virtual disk server to which to add this device.
- Physical Disk Example. This example adds a physical disk with these specifics:
- Add a virtual disk to the guest domain.The following example adds a virtual disk to the guest domain ldg1.
primary# ldm add-vdisk vdisk1 vol1@primary-vds0 ldg1
Where:
- vdisk1 is the name of the virtual disk.
- vol1 is the name of the existing volume to which to connect.
- primary-vds0 is the name of the existing virtual disk server to which to connect.
Note – The virtual disks are generic block devices that are associated with different types of physical devices, volumes, or files. A virtual disk is not synonymous with a SCSI disk and, therefore, excludes the target ID in the disk label. Virtual disks in a logical domain have the following format: cNdNsN, where cN is the virtual controller, dN is the virtual disk number, and sN is the slice.
- Set the auto-boot? and boot-device variables for the guest domain.
Note – When setting the boot-device property value, only use lowercase characters even if the name of the virtual disk contains uppercase characters.
The following example command sets auto-boot? to true for guest domain ldg1.
primary# ldm set-var auto-boot\?=true ldg1
The following example command sets boot-device to vdisk1 for guest domain ldg1.
primary# ldm set-var boot-device=vdisk1 ldg1
- Bind resources to the guest domain ldg1 and then list the domain to verify that it is bound.
primary# ldm bind-domain ldg1 primary# ldm list-domain ldg1 NAME STATE FLAGS CONS VCPU MEMORY UTIL UPTIME ldg1 bound ----- 5000 8 2G
- To find the console port of the guest domain, you can look at the output of the preceding list-domain subcommand.You can see under the heading CONS that logical domain guest 1 (ldg1) has its console output bound to port 5000.
- Connect to the console of a guest domain from another terminal by logging into the control domain and connecting directly to the console port on the local host.
$ ssh hostname.domain-name $ telnet localhost 5000
- Start the guest domain ldg1.
primary# ldm start-domain ldg1
*****************SAVE ALWAYS****************************
ldm remove-config initial
ldm add-config initial
********************************************************boot device:
ldm set-var boot-device=vdisk0 srvoe
ldm bind-domain srvoetelnet localhost 5000
Start the guest domain srvoe.
ldm start-domain srvoe
#setenv network-boot-arguments host-ip=192.168.24.39,router-ip=192.168.24.1,subnet-mask=255.255.255.0,file=http://192.168.24.216:5555/cgi-bin/wanboot-cgi
#boot netprimary# ldm stop srvoe
primary# ldm unbind srvoeldm add-vdsdev /export/home/dbausr/sol-11_3-text-sparc.iso iso_vol@primary-vds0
ldm add-vdisk vdisk_iso iso_vol@primary-vds0 srvoeldm bind srvoe
ldm start srvoeShow the device aliases in the client OpenBoot PROM.
In this example, see the device aliases for vdisk_iso, which is the Oracle Solaris ISO image, and vdisk_install, which is the disk space.
ok devalias
vdisk_iso /virtual-devices@100/channel-devices@200/disk@1
vdisk1 /virtual-devices@100/channel-devices@200/disk@0
vnet1 /virtual-devices@100/channel-devices@200/network@0
virtual-console /virtual-devices/console@1
name aliasesOn the guest domain’s console, boot from vdisk_iso (disk@1) on slice f.
ok boot vdisk_iso:f
Boot device: /virtual-devices@100/channel-devices@200/disk@1:f File and args: -s
SunOS Release 5.10 Version Generic_139555-08 64-bit
Copyright (c) 1983-2010, Oracle and/or its affiliates. All rights reserved.