Sie sind auf Seite 1von 13

Unixbod

http://www.unixbod.com/index2.php?option=com_kb&task=print&article...

How to on solaris ldoms?

Logical domains for solaris are supported on the UltraSparc T-Series CPUS. The ldmd daemon must be running and the command line management is performed using the ldm command with various options. First you have to create the virtual default services: * vdiskserver - the virtual disk server * vswitch - the virtual switch service * vconson - the virtual console concentrator service Below each one is created in turn: Create the virtual disk server (vds), it allows importing virtual disks into the logical domain. # ldm add-vds primary-vds0 primary Initiating delayed reconfigure operation on LDom primary. All configuration changes for other LDoms are disabled until the LDom reboots, at which time the new configuration for LDom primary will also take effect.

Create the virtual console concentrator service (vcc). The virtual network terminal server daemon (vntsd) will use this. # ldm add-vcc port-range=5000-5100 primary-vcc0 primary Notice: LDom primary is in the process of a delayed reconfiguration. Any changes made to this LDom will only take effect after it reboots. Create the vitual switch service (vsw) # ldm add-vsw net-dev=e1000g0 primary-vsw0 primary Notice: LDom primary is in the process of a delayed reconfiguration. Any changes made to this LDom will only take effect after it reboots. The messages after the command are normal. Listing the virtual services just created, on the primary (base OS) # 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 00:13:5f:fa:a6:46 e1000g0 switch@0 prog,promisc

Assign resources to the primary leaving other resources to the guest domain. Assign one cryptographic resource to the primary # /opt/SUNWldm/bin/ldm set-mau 1 primary

1 of 13

5/25/2012 9:38 AM

Unixbod

http://www.unixbod.com/index2.php?option=com_kb&task=print&article...

Assign 4 virtual cpus to the primary # /opt/SUNWldm/bin/ldm set-vcpu 4 primary Assign 1g of memory to the primary # /opt/SUNWldm/bin/ldm set-memory 1024m primary List current configuration of the bootmode # /opt/SUNWldm/bin/ldm list-spconfig factory-default [current] Add the initial configuration # /opt/SUNWldm/bin/ldm add-spconfig initial List the initial configuration again, to see on next boot the initial configuration will be used. # /opt/SUNWldm/bin/ldm list-spconfig factory-default [current] initial [next] List the setup of the primary bindings # /opt/SUNWldm/bin/ldm list-bindings primary NAME STATE FLAGS CONS VCPU MEMORY UTIL UPTIME primary active -n-cv SP 4 1G 0.0% 12m MAC 00:13:5f:fa:a6:46 VCPU VID PID UTIL STRAND 0 0 0.0% 100% 1 1 0.0% 100% 2 2 0.0% 100% 3 3 0.0% 100% MAU CPUSET (0, 1, 2, 3, 4, 5, 6, 7) MEMORY RA PA SIZE 0x8000000 0x8000000 1G VARIABLES boot-device=/pci@0/pci@0/pci@2/scsi@0/disk@0,0:a rootmirror disk net keyboard-layout=US-English nvramrc=devalias rootmirror /pci@0/pci@0/pci@2/scsi@0/disk@1,0 security-mode=none security-password= use-nvramrc?=true IO DEVICE PSEUDONYM OPTIONS pci@0 pci niu@80 niu VDS NAME VOLUME OPTIONS DEVICE primary-vds0

2 of 13

5/25/2012 9:38 AM

Unixbod

http://www.unixbod.com/index2.php?option=com_kb&task=print&article...

VCC NAME PORT-RANGE primary-vcc0 5000-5100 VSW NAME MAC NET-DEV DEVICE MODE primary-vsw0 00:13:5f:fa:a6:46 e1000g0 switch@0 prog,promisc VCONS NAME SERVICE PORT SP As a test virtual disk create a empty file for the virtual disk # mkfile -v 10g disk1 disk1 10737418240 bytes Add the virtual disk # ldm add-vdsdev /vdisk/disk1 vol1@primary-vds0 Create a ldom # ldm add-domain eng add 4 virtual cpus to it # ldm add-vcpu 4 eng add 512m of mem to it # ldm add-memory 512m eng add a virtual network device to it # ldm add-vnet vnet1 primary-vsw0 eng add a virtual disk # ldm add-vdisk vdisk1 vol1@primary-vds0 eng set auto-boot on ldom # ldm set-var auto-boot?=true eng set virtual boot disk # ldm set-var boot-device=vdisk eng Bind to the domain # ldm bind-domain eng Startup the domain # ldm start-domain eng Check the new domain is active # /opt/SUNWldm/bin/ldm list-domain NAME STATE FLAGS CONS VCPU MEMORY UTIL UPTIME primary active -n-cv SP 4 1G 1.1% 4h 25m eng active -t--- 5000 10 512M 10% 14m At this point the domain is created and it active, next you have to perform the OS installation using normal methods. After the installation you'll have a solaris ldom built. Connect up to the logical domain you've just created, the port range is from 5000-5100, the first port was assigned

3 of 13

5/25/2012 9:38 AM

Unixbod

http://www.unixbod.com/index2.php?option=com_kb&task=print&article...

to the virtual console. # telnet localhost 5000 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. Connecting to console "eng" in group "eng" .... Press ~? for control options .. {0} ok {0} ok {0} ok {0} ok {0} ok

{0} ok banner SPARC Enterprise T5220, No Keyboard Copyright 2007 Sun Microsystems, Inc. All rights reserved. OpenBoot 4.27.1, 512 MB memory available, Serial #xxxxxxxx. Ethernet address 00:13:5f:fa:a6:46, Host ID: xxxxxxx. {0} ok show-devs /cpu@9 /cpu@8 /cpu@7 /cpu@6 /cpu@5 /cpu@4 /cpu@3 /cpu@2 /cpu@1 /cpu@0 /virtual-devices@100 /virtual-memory /memory@m0,8000000 /aliases /options /openprom /chosen /packages /virtual-devices@100/channel-devices@200 /virtual-devices@100/console@1 /virtual-devices@100/random-number-generator@e /virtual-devices@100/ncp@6 /virtual-devices@100/n2cp@7 /virtual-devices@100/channel-devices@200/disk@0 /virtual-devices@100/channel-devices@200/network@0 /openprom/client-services /packages/obp-tftp /packages/kbd-translator /packages/SUNW,asr /packages/dropins /packages/terminal-emulator /packages/disk-label /packages/deblocker

4 of 13

5/25/2012 9:38 AM

Unixbod

http://www.unixbod.com/index2.php?option=com_kb&task=print&article...

/packages/SUNW,builtin-drivers {0} ok show-disks a) /virtual-devices@100/channel-devices@200/disk@0 q) NO SELECTION Enter Selection, q to quit: q {0} ok show-nets a) /virtual-devices@100/channel-devices@200/network@0 q) NO SELECTION Enter Selection, q to quit: q VNTSD commands ~# --Send break ~. --Exit from this console ~w --Force write access ~n --Console next ~p --Console previous ~? --Help {0} ok boot vnet0:dhcp Boot device: /virtual-devices@100/channel-devices@200/network@0:dhcp args: SunOS Release 5.10 Version Generic_118833-29 64-bit Copyright 1983-2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Configuring devices. Using DHCP for network configuration information. Setting up Java. Please wait ... Check the full configuration of eng ldom. # /opt/SUNWldm/bin/ldm list-domain -l eng NAME STATE FLAGS CONS VCPU MEMORY UTIL UPTIME eng active -t--- 5000 10 512M 10% 15m SOFTSTATE Openboot Running Host Halted VCPU VID PID UTIL STRAND 0 4 100% 100% 1 5 0.0% 100% 2 6 0.0% 100% 3 7 0.0% 100% 4 8 0.0% 100% 5 9 0.0% 100% 6 10 0.0% 100% 7 11 0.0% 100% 8 12 0.0% 100% 9 13 0.0% 100% MEMORY RA PA SIZE 0x8000000 0x48000000 512M VARIABLES nvramrc=devalias vnet0 /virtual-devices@100/channel-devices@200/network@0

File

and

5 of 13

5/25/2012 9:38 AM

Unixbod

http://www.unixbod.com/index2.php?option=com_kb&task=print&article...

use-nvramrc?=true NETWORK NAME SERVICE DEVICE MAC vnet1 primary-vsw0@primary network@0 00:13:5f:fa:a6:46 DISK NAME VOLUME TOUT DEVICE SERVER vdisk1 vol1@primary-vds0 disk@0 primary VCONS NAME SERVICE PORT eng primary-vcc0@primary 5000 Save the configuration for next reboot # ldm add-spconfig final # ldm list-spconfig factory-default [current] initial final [next] Check information on virtual processors with psrinfo: # psrinfo -vp The physical processor has 4 virtual processors (0-3) UltraSPARC-T2 (cpuid 0 clock 1167 MHz) List all devices and their allocation to ldoms # ldm ls-devices -a VCPU PID %FREE 0 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 100 15 100 16 100 17 100 18 100 19 100 20 100 21 100 22 100 23 100 24 100 25 100

6 of 13

5/25/2012 9:38 AM

Unixbod

http://www.unixbod.com/index2.php?option=com_kb&task=print&article...

26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63

100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100

MAU CPUSET BOUND (0, 1, 2, 3, 4, 5, 6, 7) primary (8, 9, 10, 11, 12, 13, 14, 15) (16, 17, 18, 19, 20, 21, 22, 23) (24, 25, 26, 27, 28, 29, 30, 31) (32, 33, 34, 35, 36, 37, 38, 39) (40, 41, 42, 43, 44, 45, 46, 47) (48, 49, 50, 51, 52, 53, 54, 55) (56, 57, 58, 59, 60, 61, 62, 63) MEMORY PA SIZE BOUND 0x0 512K _sys_ 0x80000 1536K _sys_ 0x200000 62M _sys_ 0x4000000 8M _sys_ 0x4800000 56M _sys_

7 of 13

5/25/2012 9:38 AM

Unixbod

http://www.unixbod.com/index2.php?option=com_kb&task=print&article...

0x8000000 1G primary 0x48000000 512M eng 0x68000000 31104M IO DEVICE PSEUDONYM BOUND OPTIONS pci@0 pci yes niu@80 niu yes

List unallocated devices # ldm list-devices VCPU PID %FREE 14 100 15 100 16 100 17 100 18 100 19 100 20 100 21 100 22 100 23 100 24 100 25 100 26 100 27 100 28 100 29 100 30 100 31 100 32 100 33 100 34 100 35 100 36 100 37 100 38 100 39 100 40 100 41 100 42 100 43 100 44 100 45 100 46 100 47 100 48 100 49 100 50 100 51 100 52 100 53 100 54 100 55 100 56 100

8 of 13

5/25/2012 9:38 AM

Unixbod

http://www.unixbod.com/index2.php?option=com_kb&task=print&article...

57 58 59 60 61 62 63

100 100 100 100 100 100 100

MAU CPUSET (8, 9, 10, 11, 12, 13, 14, 15) (16, 17, 18, 19, 20, 21, 22, 23) (24, 25, 26, 27, 28, 29, 30, 31) (32, 33, 34, 35, 36, 37, 38, 39) (40, 41, 42, 43, 44, 45, 46, 47) (48, 49, 50, 51, 52, 53, 54, 55) (56, 57, 58, 59, 60, 61, 62, 63) MEMORY PA SIZE 0x68000000 31104M List the constrainst used to create a logical domain # ldm list-constraints DOMAIN primary MAC 00:14:4f:97:9e:24 VCPU COUNT 4 MAU COUNT 1 MEMORY SIZE 1G VARIABLES boot-device=/pci@0/pci@0/pci@2/scsi@0/disk@0,0:a rootmirror disk net keyboard-layout=US-English nvramrc=devalias rootmirror /pci@0/pci@0/pci@2/scsi@0/disk@1,0 security-mode=none security-password= use-nvramrc?=true IO DEVICE OPTIONS pci@0 niu@80 VDS

9 of 13

5/25/2012 9:38 AM

Unixbod

http://www.unixbod.com/index2.php?option=com_kb&task=print&article...

NAME VOLUME OPTIONS DEVICE primary-vds0 vol1 /vdisk/disk1 VCC NAME PORT-RANGE primary-vcc0 5000-5100 VSW NAME MAC NET-DEV DEVICE primary-vsw0 e1000g0 switch@0

DOMAIN eng VCPU COUNT 10 MEMORY SIZE 512M VARIABLES nvramrc=devalias vnet0 devices@200/network@0 use-nvramrc?=true NETWORK NAME SERVICE DEVICE MAC vnet1 primary-vsw0 network@0 DISK NAME VOLUME TOUT vdisk1 vol1@primary-vds0 VCONS NAME SERVICE PORT eng primary-vcc0 List the logical domains which are bound. # ldm list-bindings NAME STATE FLAGS CONS VCPU MEMORY UTIL UPTIME primary active -n-cv SP 4 1G 1.2% 4h 36m MAC 00:12:4f:94:9f:24 VCPU VID PID UTIL STRAND 0 0 1.3% 100% 1 1 1.0% 100% 2 2 1.1% 100% 3 3 1.0% 100%

/virtual-devices@100/channel-

10 of 13

5/25/2012 9:38 AM

Unixbod

http://www.unixbod.com/index2.php?option=com_kb&task=print&article...

MAU CPUSET (0, 1, 2, 3, 4, 5, 6, 7) MEMORY RA PA SIZE 0x8000000 0x8000000 1G VARIABLES boot-device=/pci@0/pci@0/pci@2/scsi@0/disk@0,0:a rootmirror disk net keyboard-layout=US-English nvramrc=devalias rootmirror /pci@0/pci@0/pci@2/scsi@0 /disk@1,0 security-mode=none security-password= use-nvramrc?=true IO DEVICE PSEUDONYM OPTIONS pci@0 pci niu@80 niu VDS NAME VOLUME OPTIONS DEVICE primary-vds0 vol1 /var/crash/disk1 CLIENT VOLUME vdisk1@eng vol1 VCC NAME PORT-RANGE primary-vcc0 5000-5100 CLIENT PORT eng@eng 5000 VSW NAME MAC NET-DEV DEVICE MODE primary-vsw0 00:13:5f:fa:a6:46 prog,promisc PEER MAC vnet1@eng 00:14:4f:fa:d2:30 VCONS NAME SERVICE PORT SP

e1000g0

switch@0

NAME STATE FLAGS CONS VCPU MEMORY UTIL UPTIME eng active -t--- 5000 10 512M 10% 24m MAC 00:13:5f:fa:a6:46 VCPU VID PID UTIL STRAND 0 4 100% 100% 1 5 0.0% 100%

11 of 13

5/25/2012 9:38 AM

Unixbod

http://www.unixbod.com/index2.php?option=com_kb&task=print&article...

2 3 4 5 6 7 8 9

6 0.0% 100% 7 0.0% 100% 8 0.0% 100% 9 0.0% 100% 10 0.0% 100% 11 0.0% 100% 12 0.0% 100% 13 0.0% 100%

MEMORY RA PA SIZE 0x8000000 0x48000000 512M VARIABLES nvramrc=devalias vnet0 /virtual-devices@100/channeldevices@200/network@0 use-nvramrc?=true NETWORK NAME SERVICE DEVICE MAC vnet1 primary-vsw0@primary 00:14:4f:fa:d2:30 PEER MAC primary-vsw0@primary 00:13:5f:fa:a6:46 DISK NAME VOLUME TOUT DEVICE SERVER vdisk1 vol1@primary-vds0 disk@0 primary VCONS NAME SERVICE PORT eng primary-vcc0@primary 5000 Starting and stopping the domains. Make sure the OS is down before doing this. Check the status. # /opt/SUNWldm/bin/ldm list-domain NAME STATE FLAGS CONS VCPU MEMORY UTIL UPTIME primary active -n-cv SP 4 1G 1.0% 4h 38m eng active -t--- 5000 10 512M 10% 27m Stop a domain. # /opt/SUNWldm/bin/ldm stop-domain eng LDom eng stopped Check the status of domain. # /opt/SUNWldm/bin/ldm list-domain NAME STATE FLAGS CONS VCPU MEMORY UTIL UPTIME primary active -n-cv SP 4 1G 1.0% 4h 38m eng bound ----- 5000 10 512M Start a domain. # /opt/SUNWldm/bin/ldm start-domain eng LDom eng started

network@0

12 of 13

5/25/2012 9:38 AM

Unixbod

http://www.unixbod.com/index2.php?option=com_kb&task=print&article...

Check the status of the domain. # /opt/SUNWldm/bin/ldm list-domain NAME STATE FLAGS CONS VCPU MEMORY UTIL UPTIME primary active -n-cv SP 4 1G 2.2% 4h 39m eng active -t--- 5000 10 512M 0.0% 11s Checking the versions of ldom and ldom firmware # ldm -V Logical Domain Manager (v 1.0.1) Hypervisor control protocol v 1.0 System PROM: Hypervisor v. 1.5.1 2007/09/14 16:1115 OpenBoot 15:17 v. 4.27.1

@(#)Hypervisor

1.5.1

@(#)OBP

4.27.1

2007/09/14

List the out in a parseable format # ldm list -p VERSION 1.0 DOMAIN|name=primary|state=active|flags=-ncv|cons=SP|ncpu=4|mem=1073741824 |util=1.0|uptime=786829 DOMAIN|name=eng|state=active|flags=-t---|cons=5000|ncpu=10|mem=536870912 |util=10.0|uptime=770119
Article Id: 507 - Version: 4 - Created: 11-03-2008 - Last Updated: Keywords: solaris logical domains, ldoms,- hypervisor 12-03-2008 Hits: 7971 2012 http://www.unixbod.com - Unixbod

Powered By mosKnowledgebase - () 2005 Blue Flame IT Ltd.

13 of 13

5/25/2012 9:38 AM

Das könnte Ihnen auch gefallen