📜 ⬆️ ⬇️

Installing Fedora 16 as a full-featured PV-guest system on XenServer

In this post I would like to tell you how to install Fedora 16 as a PV guest in the XenServer / Xen Cloud Platform. In principle, the method of installing unsupported distributions described below is well known, but installing Fedora 16 posed a number of difficulties, which I had to tinker with a bit. The ready decision under a cat.


Step 1. Install HVM



Since XenServer doesn’t have any heating for Fedora, we start the installation by creating an abstract HVM machine from “Other install media”. Everything is standard here, we set the memory, the network, create the disk, attach the image with the distribution, run it. On the first screen that appears (Install or update ...), press the Tab key and add the nogpt parameter to the kernel boot command line. Otherwise, the installer will partition the disk under gpt and further the pygrub PV loader will not be able to find the kernel and ramdisk of the installed system.
')
The moment number 2. By default, the installer creates a partition / boot in ext4 format, which is again inaccessible to understanding pygrub. Therefore, do not forget to specify that / boot must be formatted in ext2

The rest of the set up the system to your liking.

Step 2. Remaking the HVM in PV



Before changing the startup parameters of the machine, you need to make a couple of changes to the grub:
  1. Traditionally, the grub.cfg configuration file is located in the / boot / grub directory. However, in Fedora 16, grub moved to the / boot / grub2 directory, and so pygrub cannot find it. To overcome this affairs link:
    [root@localhost ~]# ln /boot/grub2/grub.cfg /boot/grub
  2. Despite the fact that pygrub generally understands the grub2 format, some constructions lead to its crash with very vague messages. Specifically, in this case, pygrub explodes when it encounters this line in grub.cfg:
    set default="${saved_entry}"
    change it to
    set default=0

Everything, now it is possible to change machine parameters with a clear conscience:
[root@xcp01 bin]# xe vm-list name-label=f16
uuid ( RO) : da8d401c-93b9-67a5-5275-39c6f76e67c9
name-label ( RW): f16
power-state ( RO): halted

[root@xcp01 bin]# xe vm-param-set uuid=da8d401c-93b9-67a5-5275-39c6f76e67c9 HVM-boot-policy=""
[root@xcp01 bin]# xe vm-param-set uuid=da8d401c-93b9-67a5-5275-39c6f76e67c9 PV-bootloader=pygrub
[root@xcp01 bin]# xe vm-disk-list uuid=da8d401c-93b9-67a5-5275-39c6f76e67c9
Disk 0 VBD:
uuid ( RO) : 37301b8f-c490-c1b3-ee11-09ea749289af
vm-name-label ( RO): f16
userdevice ( RW): 0

Disk 0 VDI:
uuid ( RO) : 8259df56-47d2-494d-a1a8-437ce5388cf5
name-label ( RW): f16
sr-name-label ( RO): NetApp XCP NFS
virtual-size ( RO): 32212254720

[root@xcp01 bin]# xe vbd-param-set uuid=37301b8f-c490-c1b3-ee11-09ea749289af bootable=true
[root@xcp01 bin]# xe vm-start uuid=da8d401c-93b9-67a5-5275-39c6f76e67c9
[root@xcp01 bin]#

We are convinced that everything works fine, install XS Tools and get a complete virtual machine with all the goodies in the form of live snapshots, live migration and so on.

PS
  1. To set default did not get out in the future, you need to correct the file /etc/grub.d/00_header
  2. A similar problem came up when upgrading Ubuntu 10.10 to Ubuntu 11.04, but there pygrub broke down on processing the submenu in grub.cfg. I just cut out the generation of submenu from the scripts /etc/grub.d

Source: https://habr.com/ru/post/133518/


All Articles