Documentos de Académico
Documentos de Profesional
Documentos de Cultura
a LOGICAL DOMAIN
Contents
Overview Page 1
To begin taking advantage of LDoms, the Logical Domains Manager software needs to first be installed which then runs
OpenSolaris in a “paravirtualized” state, meaning OpenSolaris is now aware of the virtualization layer beneath it. At this
point, there's a single domain, the “primary” domain, which is ready to provide virtualization services, such as networking
and disk i/o, to guest domains.
Before guest domains can be configured, resources such as CPUs and memory need to be removed from the primary
domain so that they can later be assigned to the guest domain. As part of the guest domain's configuration, a virtual disk
(or disks) needs to be set up. These virtual disks can map either to an actual disk or to a single file, which is the approach
that is used in this How To guide.
Once created, the guest domain still needs an operating system. As stated above, this can be either Solaris or OpenSolaris.
Solaris 10 is used as the guest operating system for this guide.
The exact steps for checking and updating your firmware vary depending on your actual hardware. Please reference
http://docs.sun.com/app/docs/prod/coolthreads.srvr#hic for the specific steps that match your hardware.
jack@dcsw-t5240:~$ uname -m
sun4v
Install it as follows:
PHASE ACTIONS
Install Phase 74/74
PHASE ITEMS
Indexing Packages 1/1
The control domain is responsible for managing all of the other domains on the system and initially has all of the system
resources allocated to it. Before we can create a guest domain, we need to steal resources from the primary domain. In
the output above you can see that we have 128 virtual CPUs and 130GB of memory. The T5240 has two T2+ processors,
each with 8 cores and each core having 8 threads which gives us the total of 128 virtual CPUs. Theorectically, we could
create 127 guest domains, however allocating an entire core to a single domain is generally considered best for
peformance. That's because the T2+ processor in the T5240 I'm using has 4 cores, each represented as a virtual CPU.
You can view all of the free devices on the system by running:
ldm list-devices
At this point, the command does not return a list because all the system resources are assigned to the control domain. Use
the -a option to see all of the devices including the domain to which they're assigned:
12 0 no
13 0 no
14 0 no
15 0 no
16 0 no
17 0 no
18 0 no
19 0 no
20 0 no
21 0 no
22 0 no
23 0 no
24 0 no
25 0 no
26 0 no
27 0 no
28 0 no
29 0 no
30 0 no
31 0 no
32 0 no
33 0 no
34 0 no
35 0 no
36 0 no
37 0 no
38 0 no
39 0 no
40 0 no
41 0 no
42 0 no
43 0 no
44 0 no
45 0 no
46 0 no
47 0 no
48 0 no
49 0 no
50 0 no
51 0 no
52 0 no
53 0 no
54 0 no
55 0 no
56 0 no
57 0 no
58 0 no
59 0 no
4
OpenSolaris Operating System opensolaris.com
60 0 no
61 0 no
62 0 no
63 0 no
64 0 no
65 0 no
66 0 no
67 0 no
68 0 no
69 0 no
70 0 no
71 0 no
72 0 no
73 0 no
74 0 no
75 0 no
76 0 no
77 0 no
78 0 no
79 0 no
80 0 no
81 0 no
82 0 no
83 0 no
84 0 no
85 0 no
86 0 no
87 0 no
88 0 no
89 0 no
90 0 no
91 0 no
92 0 no
93 0 no
94 0 no
95 0 no
96 0 no
97 0 no
98 0 no
99 0 no
100 0 no
101 0 no
102 0 no
103 0 no
104 0 no
105 0 no
106 0 no
107 0 no
5
OpenSolaris Operating System opensolaris.com
108 0 no
109 0 no
110 0 no
111 0 no
112 0 no
113 0 no
114 0 no
115 0 no
116 0 no
117 0 no
118 0 no
119 0 no
120 0 no
121 0 no
122 0 no
123 0 no
124 0 no
125 0 no
126 0 no
127 0 no
MAU
ID CPUSET BOUND
0 (0, 1, 2, 3, 4, 5, 6, 7) primary
1 (8, 9, 10, 11, 12, 13, 14, 15) primary
2 (16, 17, 18, 19, 20, 21, 22, 23) primary
3 (24, 25, 26, 27, 28, 29, 30, 31) primary
4 (32, 33, 34, 35, 36, 37, 38, 39) primary
5 (40, 41, 42, 43, 44, 45, 46, 47) primary
6 (48, 49, 50, 51, 52, 53, 54, 55) primary
7 (56, 57, 58, 59, 60, 61, 62, 63) primary
8 (64, 65, 66, 67, 68, 69, 70, 71) primary
9 (72, 73, 74, 75, 76, 77, 78, 79) primary
10 (80, 81, 82, 83, 84, 85, 86, 87) primary
11 (88, 89, 90, 91, 92, 93, 94, 95) primary
12 (96, 97, 98, 99, 100, 101, 102, 103) primary
13 (104, 105, 106, 107, 108, 109, 110, 111) primary
14 (112, 113, 114, 115, 116, 117, 118, 119) primary
15 (120, 121, 122, 123, 124, 125, 126, 127) primary
MEMORY
PA SIZE BOUND
0x0 512K _sys_
0x80000 1536K _sys_
0x200000 94M _sys_
0x6000000 32M _sys_
0x8000000 96M _sys_
0xe000000 130848M primary
6
OpenSolaris Operating System opensolaris.com
IO
DEVICE PSEUDONYM BOUND OPTIONS
pci@400 pci_0 yes
pci@500 pci_1 yes
Notice in the output above that the system also has 16 MAUs, which are cryptographic Mathmatical Arithmetic Units that
are used to accelarate cryptographic processing. There's a MAU associated with each core and we'll need to deal with
those as well as we free up resources.
Free up 1 MAU for the guest domain by setting the control domain to 15 MAUs:
Free up 8 CPUs (1 core) for the guest domain by setting the control domain to 120 CPUs:
Free up 16,356 MBs of memory for the guest domain by setting the control domain to 114,492 MB:
Now list-devices shows the resources that have been made available for the guest domain:
MAU
ID CPUSET
15 (120, 121, 122, 123, 124, 125, 126, 127)
MEMORY
PA SIZE
0x1c01c00000 16356M
7
OpenSolaris Operating System opensolaris.com
Create the virtual network service. In this example it is named primary-vsw0 and maps to the physical NIC nxge0:
Create the Virtual Console Concentrator service. We will use this service to log into the domain. In this example the service
is named primary-vcc0:
VSW
NAME LDOM MAC NET-DEV DEVICE DEFAULT-VLAN-ID PVID
VID MODE
primary-vsw0 primary 00:14:4f:f9:21:7c nxge0 switch@0 1 1
VDS
NAME LDOM VOLUME OPTIONS MPGROUP DEVICE
primary-vds0 primary
Reboot the primary domain so the changes can take effect. Note, if you know you're going to be creating multiple guest
domains, allocate the minimum number of resources you need for the guest domain to minimize the need for future
reboots:
pfexec reboot
...
After reboot, you can view the new configuration for the primary domain, now using only 120 CPUs and 114492M of
memory:
Finally, enable the virtual network terminal server daemon, which provides console services to the guest domain:
Define a virtual disk service device named vol1 for the zdisk file and associate it with the primary domain:
Define a virtual disk for the guest domain named vdisk1 that uses the primary domain’s virtual disk service:
Set the auto-boot property to false so when we first start the domain it doesn't try to boot from this empty disk:
Step 7: Create a Virtual Disk for the Guest Operating System Installation DVD
Either Solaris or OpenSolaris can be installed in the guest domain. If you prefer to install OpenSolaris, you'll need to use
the Automated Installer (AI). For more information on the AI, see http://www.opensolaris.com/use/Auto_Installer.pdf.
For this How To guide Solaris 10 will be installed as the guest operating system.
Define a virtual disk service device for the ISO file and associate it with the primary domain. The disk service device
in this example is named solarisdvd:
Define a virtual disk for the guest domain that uses the primary domain’s virtual disk service. The virtual disk in this
example is named dvd:
Reduce the memory on the guest domain by 256M and try the bind again:
You can run the list command to see the full configuration of the new domain:
HOSTID
0x84fbb7bf
VCPU
VID PID UTIL STRAND
0 120 100%
1 121 100%
2 122 100%
3 123 100%
4 124 100%
5 125 100%
6 126 100%
7 127 100%
MAU
ID CPUSET
15 (120, 121, 122, 123, 124, 125, 126, 127)
MEMORY
RA PA SIZE
0x2000000 0x1c02000000 16100M
NETWORK
NAME SERVICE DEVICE MAC MODE PVID VID
vnet primary-vsw0@primary network@0 00:14:4f:fb:2e:06 1
DISK
NAME VOLUME TOUT DEVICE SERVER MPGROUP
vdisk1 vol1@primary-vds0 disk@0 primary
dvd solarisdvd@primary-vds0 disk@1 primary
VCONS
NAME SERVICE PORT
myldom primary-vcc0@primary 5000
11
OpenSolars Operating System opensolaris.com
Back in the guest domains console, you should find yourself at the OK prompt:
T5240, No Keyboard
Copyright 2008 Sun Microsystems, Inc. All rights reserved.
OpenBoot 4.29.0.a, 512 MB memory available, Serial #83528876.
Ethernet address 0:14:4f:fa:8c:ac, Host ID: 84fa8cac.
{0} ok
{0} ok devalias
dvd /virtual-devices@100/channel-devices@200/disk@1
vidsk1 /virtual-devices@100/channel-devices@200/disk@0
vnet0 /virtual-devices@100/channel-devices@200/network@0
net /virtual-devices@100/channel-devices@200/network@0
disk /virtual-devices@100/channel-devices@200/disk@0
virtual-console /virtual-devices/console@1
name aliases
Use the dvd device alias to boot and install the domain:
At this point you run through a standard installation of Solaris 10. Some items to note, the installer will recognize the
virtual network interface, vnet0:
Note, the system can also be halted from the primary domain. First, verify that the guest domain is active:
Stopping the domain using ldm stop causes an orderly shutdown. To immediately “power off” the machine, use ldm stop -f.
13
OpenSolaris Operating System opensolaris.com
Description
Logical Domains OpenSolaris Community http://opensolaris.org/os/community/ldoms/
OpenSolaris LDoms Discussion Forum http://opensolaris.org/os/community/ldoms/discussions/
OpenSolaris Automated Installion Project http://opensolaris.org/os/project/caiman/auto_install/
OpenSolaris Home Page http://www.opensolaris.com/
opensolaris.com
Sun Microsystems, Inc. 4150 Network Circle, Santa Clara, CA 95054 USA Phone 1-650-960-1300 or 1-800-555-9SUN Web sun.com
©2009 Sun Microsystems, Inc. All rights reserved. Sun, Sun Microsystems, the Sun logo, Solaris and OpenSolaris are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.
SunWIN # 487538 Lit # SWWP11968-0 06/09