Difference between revisions of "Logical Domains with ZFS"

From Peter Pap's Technowiki
Jump to: navigation, search
(Preparing the host server, the Control Domain)
(Preparing the host server, the Control Domain)
Line 58: Line 58:
 
       NAME            LDOM            VOLUME        OPTIONS          MPGROUP        DEVICE
 
       NAME            LDOM            VOLUME        OPTIONS          MPGROUP        DEVICE
 
       primary-vds0    primary
 
       primary-vds0    primary
 +
 +
9. List the crypto devices in the control domain
 +
 +
  ldm list -o crypto primary
 +
 +
Will look something like:
 +
 +
  # ldm list -o crypto primary
 +
  NAME
 +
  primary
 +
 +
  MAU
 +
      ID    CPUSET
 +
      0      (0, 1, 2, 3, 4, 5, 6, 7)
 +
      1      (8, 9, 10, 11, 12, 13, 14, 15)
 +
      2      (16, 17, 18, 19, 20, 21, 22, 23)
 +
      3      (24, 25, 26, 27, 28, 29, 30, 31)
 +
      4      (32, 33, 34, 35, 36, 37, 38, 39)
 +
      5      (40, 41, 42, 43, 44, 45, 46, 47)
 +
      6      (48, 49, 50, 51, 52, 53, 54, 55)
 +
      7      (56, 57, 58, 59, 60, 61, 62, 63)
 +
 +
10. Assign a single crypto resource to the control domain
 +
 +
  ldm set-mau 1 primary
 +
 +
Will look like:
 +
 +
  # ldm list -o crypto primary
 +
  NAME
 +
  primary
 +
 +
  MAU
 +
      ID    CPUSET
 +
      0      (0, 1, 2, 3, 4, 5, 6, 7)
 +
 +
11. Assign virtual CPU's to the control domain
 +
 +
  ldm set-vcpu 8 primary
 +
 +
12. Initial a delayed reconfiguration on the control domain
 +
 +
  ldm start-reconf primary
 +
 +
13. Assign memory to the control domain
 +
 +
  ldm set-memory 2G primary
 +
 +
14. Add a ldom config to the service processor (SP)
 +
 +
  ldm add-config initial
 +
 +
Use
 +
 +
  ldm list-config
 +
 +
to check it worked
 +
 +
15. Reboot
 +
 +
  shutdown -g 0 -i 6 -y
 +
 +
16. Enable the virtual server network terminal server daemon, to allow access to virtual consoles
 +
 +
  svcadm enable vntsd

Revision as of 04:59, 31 May 2011

Solaris Logical Domains (LDOMs) or, as it's now been christened, Oracle VM for SPARC, allows you to take any T-series processor based server and partition it into lots of fully isolated virtual servers. Unlike Solaris zones, there are no shared files. Each virtual machine gets it's own copy of Solaris! With Oracle VM Server for SPARC version 2.0, you can do lots of cool stuff also, like isolate access to a specific PCI slot to one LDOM. Here, I will outline a simple process for building LDOM's, using ZFS the storage infrastructure and then using the ZFS capabilities to clone and provision new LDOM's in a matter of minutes. The test system for this was Sun Oracle Enterprise T5220 with 8Gb of RAM and 8 x 146Gb hard drives. Two of the disks will be used to host the base OS and the remaining 6 will be used to create a ZFS RAID-Z pool to hold the LDOMs.


Preparing the host server, the Control Domain

1. Install Solaris 10 on your host system. You're a grown adult, so you decide on how you wan to partition it and what range of packages you want to install.

2. Download the Oracle VM Server for SPARC software from Oracle

3. Upload the software to your LDOM server, unpack and install

 unzip V24253-01.zip
 cd OVM_Server_SPARC-2_0/Install/
 ./install-ldm

You'll be asked if you want to configure the system now. I always prefer to do it manually later:

 Select an option for configuration:
 
 y) Yes, launch the Configuration Assistant after install
 n) No thanks, I will configure the system manually later
 
 Enter y or n [y]: n

4. Reboot

 shutdown -g0 -i6 -y

5. Create a virtual console concentrator to allow virtual console access to individual LDOMs

  ldm add-vcc port-range=5000-5100 primary-vcc0 primary

6. Create a virtual disk server (vds) to allow virtual disk to be imported into LDOMs

  ldm add-vds primary-vds0 primary

7. Create a virtual switch to allow the control domain to communicate to the LDOMs

  ldm add-vsw net-dev=e1000g0 primary-vsw0 primary

This means that all the LDOMs at this stage will be communicating with themselves and world via the same physical network port, e100g0.

8. View that the services have been created.

  ldm list-services

should look something like:

 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  
     primary-vsw0     primary          00:14:4f:fa:40:c8 e1000g0   0    switch@0              1               1                         1500        
 
 VDS
     NAME             LDOM             VOLUME         OPTIONS          MPGROUP        DEVICE
     primary-vds0     primary

9. List the crypto devices in the control domain

  ldm list -o crypto primary

Will look something like:

  # ldm list -o crypto primary
  NAME
  primary
  MAU
      ID     CPUSET
      0      (0, 1, 2, 3, 4, 5, 6, 7)
      1      (8, 9, 10, 11, 12, 13, 14, 15)
      2      (16, 17, 18, 19, 20, 21, 22, 23)
      3      (24, 25, 26, 27, 28, 29, 30, 31)
      4      (32, 33, 34, 35, 36, 37, 38, 39)
      5      (40, 41, 42, 43, 44, 45, 46, 47)
      6      (48, 49, 50, 51, 52, 53, 54, 55)
      7      (56, 57, 58, 59, 60, 61, 62, 63)

10. Assign a single crypto resource to the control domain

  ldm set-mau 1 primary

Will look like:

  # ldm list -o crypto primary
  NAME
  primary
  MAU
      ID     CPUSET
      0      (0, 1, 2, 3, 4, 5, 6, 7)

11. Assign virtual CPU's to the control domain

  ldm set-vcpu 8 primary

12. Initial a delayed reconfiguration on the control domain

  ldm start-reconf primary

13. Assign memory to the control domain

  ldm set-memory 2G primary

14. Add a ldom config to the service processor (SP)

  ldm add-config initial

Use

  ldm list-config

to check it worked

15. Reboot

  shutdown -g 0 -i 6 -y

16. Enable the virtual server network terminal server daemon, to allow access to virtual consoles

  svcadm enable vntsd