Difference between revisions of "Citrix Xen Server"

From Univention Wiki

Jump to: navigation, search
 
(19 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
{{Version|UCS=3.1}}
 
{{Version|UCS=3.1}}
{{Review-Status}}
+
{{DISPLAYTITLE:Citrix XenServer}}
  
 
= Introduction =
 
= Introduction =
 +
This article decribes the UCS installation on Citrix XenServer.
  
 
XenServer is a virtualization solution from Citrix. It is based on the open source Xen Hypervisor. This information applies to XenServer 6.1.
 
XenServer is a virtualization solution from Citrix. It is based on the open source Xen Hypervisor. This information applies to XenServer 6.1.
Line 14: Line 15:
 
= Installation of UCS in HVM mode =
 
= Installation of UCS in HVM mode =
  
A new virtual machine can be created via ''New VM'' in XenCenter. As template ''Other Install Media'' must be selected. As installation media the UCS DVD can be used.
+
A new virtual machine can be created via ''New VM'' in XenCenter. The template ''Other Install Media'' must be selected. As installation media the UCS DVD can be used.
 +
 
 +
Currently the boot menu of the DVD is not shown during the boot in the XenCenter console. The UCS installer is available after about two minutes. For more details see [https://forge.univention.org/bugzilla/show_bug.cgi?id=30978 here] and [https://forge.univention.org/bugzilla/show_bug.cgi?id=31051 here].
  
 
During the partitioning the following issues should be considered:
 
During the partitioning the following issues should be considered:
 
# ''/boot'' must be the first partition
 
# ''/boot'' must be the first partition
# ''/boot'' must use ext3 as filesystem
+
# ''/boot'' must use ext3 as file system
  
 
= Preparing the UCS installation for the paravirtualization convertion =
 
= Preparing the UCS installation for the paravirtualization convertion =
If ''/boot'' is not the first partition or ext4 has been used as filesystem for it, it is necassary to change it. This example converts an auto partitioning system. '''Please be careful! This is only an example, you have to adapt it to your environment.'''
+
If ''/boot'' is not the first partition or ''ext4'' has been used as file system for it, it is necessary to change it. This example converts a system that was installed using automatic partitioning. '''Please be careful! This is only an example, you have to adapt it to your environment.'''
 
# First parted should be installed, for example as user ''root'' on the console: <pre>root@ucs-server:~# univention-install parted</pre>
 
# First parted should be installed, for example as user ''root'' on the console: <pre>root@ucs-server:~# univention-install parted</pre>
 
# The current partition table must be checked, for example: <pre>root@ucs-server:~# parted &#10; GNU Parted 2.3 &#10; Using /dev/sda &#10; Welcome to GNU Parted! Type 'help' to view a list of commands. &#10; (parted) p &#10; Model: ATA QEMU HARDDISK (scsi) &#10; Disk /dev/sda: 10.7GB &#10; Sector size (logical/physical): 512B/512B &#10; Partition Table: gpt &#10; &#10; Number  Start  End    Size    File system    Name                Flags &#10; 1      16.8MB  25.2MB  8389kB                  BIOS Boot Partition  bios_grub &#10; 2      25.2MB  562MB  537MB  ext4            /boot &#10; 3      562MB  1592MB  1030MB  linux-swap(v1)  SWAP &#10; 4      1593MB  10.6GB  9010MB                  LVMPV                lvm &#10; &#10; (parted) q</pre>
 
# The current partition table must be checked, for example: <pre>root@ucs-server:~# parted &#10; GNU Parted 2.3 &#10; Using /dev/sda &#10; Welcome to GNU Parted! Type 'help' to view a list of commands. &#10; (parted) p &#10; Model: ATA QEMU HARDDISK (scsi) &#10; Disk /dev/sda: 10.7GB &#10; Sector size (logical/physical): 512B/512B &#10; Partition Table: gpt &#10; &#10; Number  Start  End    Size    File system    Name                Flags &#10; 1      16.8MB  25.2MB  8389kB                  BIOS Boot Partition  bios_grub &#10; 2      25.2MB  562MB  537MB  ext4            /boot &#10; 3      562MB  1592MB  1030MB  linux-swap(v1)  SWAP &#10; 4      1593MB  10.6GB  9010MB                  LVMPV                lvm &#10; &#10; (parted) q</pre>
# If ''/boot'' is ext4 or not the first partition, like in this example, the content of ''/boot'' should be saved, for example <pre>cp -a /boot /boot.BACKUP</pre>
+
# If ''/boot'' is ''ext4'' or not the first partition, like in this example, the content of ''/boot'' should be saved, for example <pre>cp -a /boot /boot.BACKUP</pre>
 
# After that ''/boot'' should be unmounted <pre>umount /boot</pre>
 
# After that ''/boot'' should be unmounted <pre>umount /boot</pre>
# In this example the BIOS boot partition is the first partition and ''/boot'' the second. The partition should be deleted and re-created in different order, for example: <pre>root@ucs-server:~# parted&#10; [...]&#10; (parted) p&#10; Model: ATA QEMU HARDDISK (scsi)&#10; Disk /dev/sda: 10.7GB&#10; Sector size (logical/physical): 512B/512B&#10; Partition Table: gpt&#10; &#10; Number  Start  End    Size    File system    Name                Flags&#10; 1      16.8MB  25.2MB  8389kB                  BIOS Boot Partition  bios_grub&#10; 2      25.2MB  562MB  537MB  ext4            /boot&#10; 3      562MB  1592MB  1030MB  linux-swap(v1)  SWAP&#10; 4      1593MB  10.6GB  9010MB                  LVMPV                lvm&#10; &#10; (parted) rm 1&#10; (parted) rm 2&#10; (parted) mkpart 1 ext3 16MB 528MB&#10; (parted) mkpart 2 528MB 537MB&#10; (parted) set 2 bios_grub on&#10; (parted) quit</pre>
+
# In this example the BIOS boot partition is the first partition and ''/boot'' the second. The partition should be deleted and re-created in different order, for example: <pre>root@ucs-server:~# parted&#10; [...]&#10; (parted) p&#10; Model: ATA QEMU HARDDISK (scsi)&#10; Disk /dev/sda: 10.7GB&#10; Sector size (logical/physical): 512B/512B&#10; Partition Table: gpt&#10; &#10; Number  Start  End    Size    File system    Name                Flags&#10; 1      16.8MB  25.2MB  8389kB                  BIOS Boot Partition  bios_grub&#10; 2      25.2MB  562MB  537MB  ext4            /boot&#10; 3      562MB  1592MB  1030MB  linux-swap(v1)  SWAP&#10; 4      1593MB  10.6GB  9010MB                  LVMPV                lvm&#10; &#10; (parted) rm 1&#10; (parted) rm 2&#10; (parted) mkpart "/boot" ext3 16MB 528MB&#10; (parted) mkpart "BIOS Boot Partition" 528MB 537MB&#10; (parted) set 2 bios_grub on&#10; (parted) quit</pre>
# Now ''/boot'' and the BIOS Boot Partition have been created in the correct order. A filesystem on the ''/boot'' partition has to be created: <pre>root@ucs-server:~# mkfs.ext3 /dev/sda1</pre>
+
# Now ''/boot'' and the BIOS Boot Partition have been recreated in the correct order. A file system on the ''/boot'' partition has to be created: <pre>root@ucs-server:~# mkfs.ext3 /dev/sda1</pre>
# After that the file ''/etc/fstab'' must be updated to the new partition informations, the new UUID and ext3 instead of ext4: <pre>root@ucs-server:~# uuid=$(blkid -o value /dev/sda1 | head -n 1)&#10;root@ucs-server:~# sed -i "s|UUID=.*[\t ]*/boot|UUID=$uuid\t/boot|" /etc/fstab&#10;root@ucs-server:~# sed -i 's|\(/boot[\t ]*\)ext4|\1ext3|' /etc/fstab</pre>
+
# After that the file ''/etc/fstab'' must be updated with the new partition information, the new UUID and ''ext3'' instead of ''ext4'': <pre>root@ucs-server:~# uuid=$(blkid -o value /dev/sda1 | head -n 1)&#10;root@ucs-server:~# sed -i "s|UUID=.*[\t ]*/boot|UUID=$uuid\t/boot|" /etc/fstab&#10;root@ucs-server:~# sed -i 's|\(/boot[\t ]*\)ext4|\1ext3|' /etc/fstab</pre>
 
# Now ''/boot'' can be mounted and the backup can be copied to the new partition, for example: <pre>root@ucs-server:~# mount /boot&#10;root@ucs-server:~# cp -a /boot.BACKUP/* /boot/&#10;</pre>
 
# Now ''/boot'' can be mounted and the backup can be copied to the new partition, for example: <pre>root@ucs-server:~# mount /boot&#10;root@ucs-server:~# cp -a /boot.BACKUP/* /boot/&#10;</pre>
# Since the BIOS Boot Partition has been created new, grub must be installed again: <pre>root@ucs-server:~# grub-install /dev/sda&#10;Installation finished. No error reported.&#10;root@ucs-server:~#</pre>
+
# Since the BIOS Boot Partition has been recreated, grub must be reinstalled: <pre>root@ucs-server:~# grub-install /dev/sda&#10;Installation finished. No error reported.&#10;root@ucs-server:~# update-grub&#10;Generating grub.cfg ...&#10;[...]
 +
</pre>
 
The system should be rebooted to test if these changes were successful.
 
The system should be rebooted to test if these changes were successful.
  
 
= Convert the UCS system to paravirtualization =
 
= Convert the UCS system to paravirtualization =
If ''/boot'' is the first partition and ext3 is used as filesystem, the following steps have to be done:
+
If ''/boot'' is the first partition and the file system is in ''ext3'' format, the following steps have to be done:
# To prepare the system to use the Citrix XenServer terminal a getty process should be started on hvc0, for example: <pre>root@ucs-server:~# echo "vc:2345:respawn:/sbin/getty 38400 hvc0" >>/etc/inittab</pre>
+
# To prepare the system to use the Citrix XenServer console a getty process should be started on ''hvc0'': <pre>root@ucs-server:~# echo "vc:2345:respawn:/sbin/getty 38400 hvc0" >>/etc/inittab</pre>
 
# Shut down the UCS system: <pre>root@ucs-server:~# halt -p</pre>
 
# Shut down the UCS system: <pre>root@ucs-server:~# halt -p</pre>
# Get the UUID of the UCS virtual machine, "ucs-vm" should be replaced with the name of the UCS virtual machine, for example: <pre>[root@xenserver-citrix ~]# UUID=$(xe vm-list name-label="ucs-vm" params=uuid --minimal)&#10;[root@xenserver-citrix ~]# echo $UUID</pre>
+
# Get the UUID of the UCS virtual machine, "ucs-vm" should be replaced with the name of the UCS virtual machine: <pre>[root@xenserver-citrix ~]# UUID=$(xe vm-list name-label="ucs-vm" params=uuid --minimal)&#10;[root@xenserver-citrix ~]# echo $UUID</pre>
# Disable HVM for this virtual machine and activate PV <pre>[root@xenserver-citrix ~]# xe vm-param-set uuid=$UUID HVM-boot-policy=""&#10;[root@xenserver-citrix ~]# xe vm-param-set uuid=$UUID PV-bootloader=pygrub&#10;[root@xenserver-citrix ~]# xe vm-param-set uuid=$UUID PV-args="console=hvc0"</pre>
+
# Disable HVM for this virtual machine and activate PV: <pre>[root@xenserver-citrix ~]# xe vm-param-set uuid=$UUID HVM-boot-policy=""&#10;[root@xenserver-citrix ~]# xe vm-param-set uuid=$UUID PV-bootloader=pygrub&#10;[root@xenserver-citrix ~]# xe vm-param-set uuid=$UUID PV-args="console=hvc0"</pre>
# Search the configured hard disk. In this given example the first entry is the DVD (hdd) and the second entry is the hard disk (hda): <pre>[root@xenserver-citrix ~]# xe vbd-list vm-uuid=$UUID&#10; uuid ( RO)            : 56c0d70d-7b82-569d-e9a4-11f6d0bf3520&#10; vm-uuid ( RO): 6ecc2dd6-ff68-5d6d-f7e7-912f25ea244f&#10; vm-name-label ( RO): ucs-vm&#10; vdi-uuid ( RO): <not in database>&#10; empty ( RO): true&#10; device ( RO): hdd&#10; &#10; &#10; uuid ( RO)            : 3c43c999-071b-cedf-e66e-4d06d3b16494&#10; vm-uuid ( RO): 6ecc2dd6-ff68-5d6d-f7e7-912f25ea244f&#10; vm-name-label ( RO): ucs-vm&#10; vdi-uuid ( RO): 2515b8e1-dc90-4363-8112-6c2cfdc1901e&#10; empty ( RO): false&#10; device ( RO): hda</pre>
+
# Search the configured hard disk. In this given example the first entry is the DVD (hdd) and the second entry is the hard disk (hda): <pre>[root@xenserver-citrix ~]# xe vbd-list vm-uuid=$UUID&#10; uuid ( RO)            : 56c0d70d-7b82-569d-e9a4-11f6d0bf3520&#10;         vm-uuid ( RO): 6ecc2dd6-ff68-5d6d-f7e7-912f25ea244f&#10;   vm-name-label ( RO): ucs-vm&#10;         vdi-uuid ( RO): <not in database>&#10;           empty ( RO): true&#10;           device ( RO): hdd&#10; &#10; &#10; uuid ( RO)            : 3c43c999-071b-cedf-e66e-4d06d3b16494&#10;         vm-uuid ( RO): 6ecc2dd6-ff68-5d6d-f7e7-912f25ea244f&#10;   vm-name-label ( RO): ucs-vm&#10;         vdi-uuid ( RO): 2515b8e1-dc90-4363-8112-6c2cfdc1901e&#10;           empty ( RO): false&#10;           device ( RO): hda</pre>
# The hard disk is to configured as bootable, for example: <pre>[root@xenserver-citrix ~]# xe vbd-param-set uuid=$DISK_UUID bootable=true</pre>
+
# The hard disk must be configured as bootable, for example: <pre>[root@xenserver-citrix ~]# xe vbd-param-set uuid=3c43c999-071b-cedf-e66e-4d06d3b16494 bootable=true</pre>
 
# After that the virtual machine can be started.
 
# After that the virtual machine can be started.
  
Line 47: Line 51:
  
 
[[Category:EN]]
 
[[Category:EN]]
[[Category:Installation]]
 
[[Category:Virtualization]]
 

Latest revision as of 12:21, 4 November 2016

Produktlogo UCS Version 3.1


Introduction

This article decribes the UCS installation on Citrix XenServer.

XenServer is a virtualization solution from Citrix. It is based on the open source Xen Hypervisor. This information applies to XenServer 6.1.

For the administration of XenServer the windows tool XenCenter can be used. The Xen hvypervisor supports two different types of virtualization:

  • Paravirtualization - modified guests (PV)
  • Hardware-assisted virtualization, allowing for unmodified guests (HVM)

The installation of UCS as a PV virtual machine is currently not possible, therefore the UCS installation is converted afterwards from HVM to PV.

Installation of UCS in HVM mode

A new virtual machine can be created via New VM in XenCenter. The template Other Install Media must be selected. As installation media the UCS DVD can be used.

Currently the boot menu of the DVD is not shown during the boot in the XenCenter console. The UCS installer is available after about two minutes. For more details see here and here.

During the partitioning the following issues should be considered:

  1. /boot must be the first partition
  2. /boot must use ext3 as file system

Preparing the UCS installation for the paravirtualization convertion

If /boot is not the first partition or ext4 has been used as file system for it, it is necessary to change it. This example converts a system that was installed using automatic partitioning. Please be careful! This is only an example, you have to adapt it to your environment.

  1. First parted should be installed, for example as user root on the console:
    root@ucs-server:~# univention-install parted
  2. The current partition table must be checked, for example:
    root@ucs-server:~# parted 
     GNU Parted 2.3 
     Using /dev/sda 
     Welcome to GNU Parted! Type 'help' to view a list of commands. 
     (parted) p 
     Model: ATA QEMU HARDDISK (scsi) 
     Disk /dev/sda: 10.7GB 
     Sector size (logical/physical): 512B/512B 
     Partition Table: gpt 
     
     Number  Start   End     Size    File system     Name                 Flags 
     1      16.8MB  25.2MB  8389kB                  BIOS Boot Partition  bios_grub 
     2      25.2MB  562MB   537MB   ext4            /boot 
     3      562MB   1592MB  1030MB  linux-swap(v1)  SWAP 
     4      1593MB  10.6GB  9010MB                  LVMPV                lvm 
     
     (parted) q
  3. If /boot is ext4 or not the first partition, like in this example, the content of /boot should be saved, for example
    cp -a /boot /boot.BACKUP
  4. After that /boot should be unmounted
    umount /boot
  5. In this example the BIOS boot partition is the first partition and /boot the second. The partition should be deleted and re-created in different order, for example:
    root@ucs-server:~# parted
     [...]
     (parted) p
     Model: ATA QEMU HARDDISK (scsi)
     Disk /dev/sda: 10.7GB
     Sector size (logical/physical): 512B/512B
     Partition Table: gpt
     
     Number  Start   End     Size    File system     Name                 Flags
     1      16.8MB  25.2MB  8389kB                  BIOS Boot Partition  bios_grub
     2      25.2MB  562MB   537MB   ext4            /boot
     3      562MB   1592MB  1030MB  linux-swap(v1)  SWAP
     4      1593MB  10.6GB  9010MB                  LVMPV                lvm
     
     (parted) rm 1
     (parted) rm 2
     (parted) mkpart "/boot" ext3 16MB 528MB
     (parted) mkpart "BIOS Boot Partition" 528MB 537MB
     (parted) set 2 bios_grub on
     (parted) quit
  6. Now /boot and the BIOS Boot Partition have been recreated in the correct order. A file system on the /boot partition has to be created:
    root@ucs-server:~# mkfs.ext3 /dev/sda1
  7. After that the file /etc/fstab must be updated with the new partition information, the new UUID and ext3 instead of ext4:
    root@ucs-server:~# uuid=$(blkid -o value /dev/sda1 | head -n 1)
    root@ucs-server:~# sed -i "s|UUID=.*[\t ]*/boot|UUID=$uuid\t/boot|" /etc/fstab
    root@ucs-server:~# sed -i 's|\(/boot[\t ]*\)ext4|\1ext3|' /etc/fstab
  8. Now /boot can be mounted and the backup can be copied to the new partition, for example:
    root@ucs-server:~# mount /boot
    root@ucs-server:~# cp -a /boot.BACKUP/* /boot/
    
  9. Since the BIOS Boot Partition has been recreated, grub must be reinstalled:
    root@ucs-server:~# grub-install /dev/sda
    Installation finished. No error reported.
    root@ucs-server:~# update-grub
    Generating grub.cfg ...
    [...]

The system should be rebooted to test if these changes were successful.

Convert the UCS system to paravirtualization

If /boot is the first partition and the file system is in ext3 format, the following steps have to be done:

  1. To prepare the system to use the Citrix XenServer console a getty process should be started on hvc0:
    root@ucs-server:~# echo "vc:2345:respawn:/sbin/getty 38400 hvc0" >>/etc/inittab
  2. Shut down the UCS system:
    root@ucs-server:~# halt -p
  3. Get the UUID of the UCS virtual machine, "ucs-vm" should be replaced with the name of the UCS virtual machine:
    [root@xenserver-citrix ~]# UUID=$(xe vm-list name-label="ucs-vm" params=uuid --minimal)
    [root@xenserver-citrix ~]# echo $UUID
  4. Disable HVM for this virtual machine and activate PV:
    [root@xenserver-citrix ~]# xe vm-param-set uuid=$UUID HVM-boot-policy=""
    [root@xenserver-citrix ~]# xe vm-param-set uuid=$UUID PV-bootloader=pygrub
    [root@xenserver-citrix ~]# xe vm-param-set uuid=$UUID PV-args="console=hvc0"
  5. Search the configured hard disk. In this given example the first entry is the DVD (hdd) and the second entry is the hard disk (hda):
    [root@xenserver-citrix ~]# xe vbd-list vm-uuid=$UUID
     uuid ( RO)             : 56c0d70d-7b82-569d-e9a4-11f6d0bf3520
              vm-uuid ( RO): 6ecc2dd6-ff68-5d6d-f7e7-912f25ea244f
        vm-name-label ( RO): ucs-vm
             vdi-uuid ( RO): <not in database>
                empty ( RO): true
               device ( RO): hdd
     
     
     uuid ( RO)             : 3c43c999-071b-cedf-e66e-4d06d3b16494
              vm-uuid ( RO): 6ecc2dd6-ff68-5d6d-f7e7-912f25ea244f
        vm-name-label ( RO): ucs-vm
             vdi-uuid ( RO): 2515b8e1-dc90-4363-8112-6c2cfdc1901e
                empty ( RO): false
               device ( RO): hda
  6. The hard disk must be configured as bootable, for example:
    [root@xenserver-citrix ~]# xe vbd-param-set uuid=3c43c999-071b-cedf-e66e-4d06d3b16494 bootable=true
  7. After that the virtual machine can be started.

Convert back from PV to HVM

  1. A system can be converted back to HVM with the following steps:
    [root@xenserver-citrix ~]# UUID=$(xe vm-list name-label="ucs-vm" params=uuid --minimal)
    [root@xenserver-citrix ~]# xe vm-param-set uuid=$UUID HVM-boot-policy="BIOS order"
    [root@xenserver-citrix ~]# xe vm-param-set uuid=$UUID PV-bootloader""
Personal tools