Difference between revisions of "Citrix Xen Server"
From Univention Wiki
(19 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{Version|UCS=3.1}} | {{Version|UCS=3.1}} | ||
− | {{ | + | {{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. | + | 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 | + | # ''/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 | + | 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 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</pre> | # The current partition table must be checked, for example: <pre>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</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 [...] (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 | + | # 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 [...] (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</pre> |
− | # Now ''/boot'' and the BIOS Boot Partition have been | + | # 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 | + | # 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) 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</pre> |
# Now ''/boot'' can be mounted and the backup can be copied to the new partition, for example: <pre>root@ucs-server:~# mount /boot root@ucs-server:~# cp -a /boot.BACKUP/* /boot/ </pre> | # Now ''/boot'' can be mounted and the backup can be copied to the new partition, for example: <pre>root@ucs-server:~# mount /boot root@ucs-server:~# cp -a /boot.BACKUP/* /boot/ </pre> | ||
− | # Since the BIOS Boot Partition has been | + | # Since the BIOS Boot Partition has been recreated, grub must be reinstalled: <pre>root@ucs-server:~# grub-install /dev/sda Installation finished. No error reported. root@ucs-server:~# update-grub Generating grub.cfg ... [...] |
+ | </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 | + | 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 | + | # 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 | + | # 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) [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="" [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"</pre> | + | # Disable HVM for this virtual machine and activate PV: <pre>[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"</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 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</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 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</pre> |
− | # The hard disk | + | # 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]] | ||
− | |||
− |
Latest revision as of 12:21, 4 November 2016
Contents
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:
- /boot must be the first partition
- /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.
- First parted should be installed, for example as user root on the console:
root@ucs-server:~# univention-install parted
- 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
- 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
- After that /boot should be unmounted
umount /boot
- 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
- 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
- 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
- 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/
- 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:
- 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
- Shut down the UCS system:
root@ucs-server:~# halt -p
- 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
- 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"
- 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
- 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
- After that the virtual machine can be started.
Convert back from PV to HVM
- 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""