Creating Logical Domains (LDoms) on Solaris 11


http://techsupportpk.blogspot.com/2013/08/ldoms.html

This article focusing on the basic administration of a Logical Domains environment under Solaris 11 Operating System.  In this article we will go over what it takes to configure a Solaris 11 installation to be a Logical Domains hypervisor as well as configuring Logical Domains in order to perform an installation of the operating system.





Before we start

Check Operating System Version

This is the released version of Solaris 11 for SPARC, which of course means it can only be used on the SPARC processor architecture.

root@labsrv:~# uname –a
SunOS t4 5.11 11.0 sun4v sparc sun4v

View Logical Domains Software Version

The release version of Solaris 11 for SPARC comes with Logical Domains 2.1.  If you have purchased support and configured access to the repositories then pkg update will give you access to Logical Domains 2.2.

root@labsrv:~# ldm -V

Logical Domains Manager (v 2.1.0.4)
Hypervisor control protocol v 1.7
Using Hypervisor MD v 1.3

System PROM:
Hostconfig      v. 1.1.1        @(#)Hostconfig 1.1.1 2011/08/03
Hypervisor      v. 1.10.1.      @(#)Hypervisor 1.10.1.b 2011/09/12
OpenBoot        v. 4.33.1       @(#)OpenBoot 4.33.1 2011/08/03

View Existing Logical Domains

Here we see the specifics of our physical machine.  The primary domain has all of the resources and before we will be able to allocate resources to other Logical domains we will need to remove some from the primary domain.
root@labsrv:~# ldm list
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  UPTIME
primary          active     -n-c--  UART    64    32256M   0.0%  1d 10h 15m

Create Services for Control Domain

Here we are creating the Virtual Console Concentrator service.  This is what allows us to connect to the console of the domains for installation and reconfiguration.

root@labsrv:~# ldm add-vcc port-range=5000-5100 primary-vcc0 primary

Virtual Disk Service

root@labsrv:~# ldm add-vds primary-vds0 primary

Virtual Switch Service

root@labsrv:~# ldm add-vsw net-dev=net0 primary-vsw0 primary

Verify Changes


root@labsrv:~# ldm list-services primary
VCC
NAME                 LDOM             PORT-RANGE
primary-vcc0          primary          5000-5100

VSW
NAME             LDOM             MAC               NET-DEV   ID   DEVICE     LINKPROP   DEFAULT-VLAN-ID PVID VID                  MTU   MODE   INTER-VNET-LINK
Primary-vsw0     primary          00:14:4f:fb:bd:bd net0      0    switch@0              1               1                         1500         on

VDS
NAME             LDOM             VOLUME         OPTIONS          MPGROUP        DEVICE
Primary-vds0          primary 

Configure the Control Domain

By default we have primary domain, which mean the host operating system.

root@labsrv:~# ldm list
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  UPTIME
primary          active     -n-c--  UART    64    32256M   0.0%  1d 30m

We have to reduce the number of vCPU and Memory from the the control domain to make available to the logical domains.

root@labsrv:~# ldm set-vcpu 4 primary
root@labsrv:~# ldm set-memory 4G primary

Reconfigure primary domain to update changes.

root@labsrv:~# ldm start-reconf primary

Initiating a delayed reconfiguration operation on the primary domain. All configuration changes for other domains are disabled until the primary domain reboots, at which time the new configuration for the primary domain will also take effect.

Create alternate configuration file.

root@labsrv:~# ldm add-config primary-config
root@labsrv:~# ldm list-config
factory-default
primary-config [current]

Enable the Virtual Network Terminal Server Daemon.

root@labsrv:~# svcadm enable vntsd
root@labsrv:~# svcs | grep vntsd
online         13:10:01 svc:/ldoms/vntsd:default

Reboot now.

root@labsrv:~# reboot

After a reboot, make sure the primary domain must reflect the new memory and vCPU configuration.

root@labsrv:~# ldm list
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  UPTIME
primary          active     -n-cv-  UART    4     4G       0.4%  00h 15m

Create Install Media Repository

Create a ZFS file system to store ISO images of Solaris operating system.
root@labsrv:~# zfs create -p rpool/ldoms/OSImages

Add the Solaris iso images to the Virtual Disk Server service.
root@labsrv:~# ldm add-vdsdev /rpool/ldoms/OSImages/sol-10-u10-ga2-sparc-dvd.iso solaris10_media@primary-vds0

root@labsrv:~# ldm add-vdsdev /rpool/ldoms/OSImages/sol-11-11.11-sparc.iso solaris11_media@primary-vds0

Create the Logical Domain

root@labsrv:~# ldm add-domain newdom1
root@labsrv:~# ldm add-vcpu 4 newdom1
root@labsrv:~# ldm add-memory 4G newdom1
root@labsrv:~# ldm add-vnet vnet1 primary-vsw0 newdom1

Add installation media to newly create logical domain

root@labsrv:~# ldm add-vdisk sol-11-sparc.iso solaris11_media@primary-vds0 newdom1

Configure Virtual Disks

root@labsrv:~# zfs create -p -V 30G rpool/ldoms/newdom1/disk0
root@labsrv:~# zfs create -p -V 30G rpool/ldoms/newdom1/disk1

Add Vdisks volumes to the Virtual Disk Server service (pvdisk0).

root@labsrv:~# ldm add-vdsdev /dev/zvol/dsk/rpool/ldoms/newdom1/disk0 newdom1-disk0@primary-vds0

root@labsrv:~# ldm add-vdsdev /dev/zvol/dsk/rpool/ldoms/newdom1/disk1 newdom1-disk1@primary-vds0

Assign Virtual Disks to newly created logical domain

root@labsrv:~# ldm add-vdisk disk0 newdom1-disk0@primary-vds0 newdom1
root@labsrv:~# ldm add-vdisk disk1 newdom1-disk1@primary-vds0 newdom1

Configure Boot Devices (to autoboot from primary disk0)

root@labsrv:~# ldm set-var auto-boot\?=true newdom1
root@labsrv:~# ldm set-var boot-device=disk0 newdom1

Set the Host ID

root@labsrv:~# ldm set-domain hostid=58e92820 newdom1

Before we start the logical domain, we need to bind the associated resources to the logical domain.  This will also show us the port that the console is running on, so that we can connect to it.

root@labsrv:~# ldm list
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  UPTIME
primary          active     -n-cv-  UART    4     4G       0.8%  4h 20m
newdom1          inactive   ------          4     4G

root@labsrv:~# ldm bind-domain newdom1
root@labsrv:~# ldm list
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  UPTIME
primary          active     -n-cv-  UART    4     4G       3.0%  4h 21m
newdom1          bound      ------  5000    4     4G    

Connect newdom1 prior to starting the domain, because we prefer to watch the boot up process, so that we know everything is working properly, this means we will have a separate ssh session which we use for telnet.

root@labsrv:~# telnet localhost 5000
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to t4.
Escape character is '^]'.

Connecting to console "newdom1" in group "newdom1" ....
Press ~? for control options ..

Start the domain.

root@labsrv:~# ldm start-domain newdom1
LDom newdom1 started

SPARC T4-1, No Keyboard
Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
OpenBoot 4.33.1, 4096 MB memory available, Serial #58496027.
Ethernet address 0:14:4f:fb:e:4a, Host ID: 58fb0e4a.

Boot device: disk0  File and args:
Bad magic number in disk label
ERROR: /virtual-devices@100/channel-devices@200/disk@0: Can't open disk label package

ERROR: boot-read fail

Evaluating:

Can't open boot device

{0} ok

Now boot newdom1 from Solaris 11 installation media

{0} ok boot sol-11-sparc.iso

That’s all.
Powered by Blogger.