XCP-ng / Citrix Hypervisor

Check boot filesystem

To check the file system of a Citrix XenServer Host, complete the following procedure:

  1. Insert the installation CD 1 of the XenServer host into CD-ROM drive where the file system to check is located.

  2. Start the installation process and stop when it displays the Confirm Installation dialog box and to click Install XenServer. From the message displayed in the dialog box, note the path for the disk. For example: "Please confirm you wish to proceed: all data on disk /dev/sda will be destroyed."

  3. Press ALT + F2 (you can toggle between the installation screen and the command prompt using ALT + F1 and ALT + F2). It prompts you to log on. Log on as the root user and the following prompt is displayed:
    [root@(none)~]#

  4. Run the fsck command as follows:
    [root@(none)~]# fsck /dev/sda1

  5. reboot

Generate SSL Certificates

Clear the “request was aborted:Could not create ssl/tls secure channel” error.

Issue:
The generated SSL cert on the pool master isn’t good enough for Windows 10.

Fix:
Make a new certificate.

Modify the shell script /opt/xensource/libexec/generate_ssl_cert and find the section that reads:

openssl genrsa > privkey.rsa
openssl req -batch -new -x509 -key privkey.rsa -days 3650 -config config -out cert.csr
openssl dhparam 512 > dh.pem

Change it to the following:

openssl genrsa 1024 > privkey.rsa
openssl req -batch -new -x509 -key privkey.rsa -days 3650 -config config -out cert.csr
openssl dhparam 1024 > dh.pem

Run the following commands

mv /etc/xensource/xapi-ssl.pem /etc/xensource/xapi-ssl.pem.bak
/opt/xensource/libexec/generate_ssl_cert "/etc/xensource/xapi-ssl.pem" $(hostname -f)
xe-toolstack-restart

You should see it generating 1024 bit keys.

A reboot might be needed.

 

Install - Network

Requirements

The PXE server requires a Dynamic Host Configuration Protocol (DHCP) server to provide IP addresses to the PXE-booting systems, and either an NFS, FTP, or an HTTP server to house the installation files. Files can all co-exist on the same server, or be distributed on different servers on the network. Each XCP host needs a PXE boot-enabled Ethernet card.

TFTP setup:  For tips on installing a TFTP server see Tech Notes.

A copy of the extracted ISO file should be accessible by the host via http. This path could also be used for rolling pool upgrades. See Tech notes for additional steps and features for configuring local repositories.

PXELinux

Add an XCP entry into pxelinux.cfg/default

LABEL xcp
MENU LABEL XCP-ng
KERNEL mboot.c32
APPEND xcp/xen.gz dom0_max_vcpus=1-2 dom0_mem=1024M,max:1024M com1=115200,8n1 console=com1,vga --- xcp/vmlinuz xencons=hvc console=hvc0 console=tty0 install --- xcp/install.img

Copy the files mboot.c32 from /usr/lib/syslinux to the /var/lib//tftboot directory.

Copy the files install.img, vmlinuz*, and all files in the boot directory from the installation CD to /var/lib/tftpboot/xcp.

The xcp directory should look simalar to this:

xcp/					<- Most of these files come from /boot on the .iso
├── efiboot.img
├── gcdx64.efi
├── grubx64.efi
├── install.img			<- This is /install.img on the .iso
├── isolinux
│   ├── boot.cat
│   ├── isolinux.bin
│   ├── isolinux.cfg
│   ├── mboot.c32		<- From /boot/pxelinux on the iso
│   ├── memtest			
│   ├── menu.c32		<- From /boot/pxelinux on the iso
│   ├── pg_help
│   ├── pg_main
│   └── splash.lss
├── vmlinuz
└── xen.gz
Answer files

The Answerfile documentation is lacking at the Citrix website. Somethings you'll just have to experiment with.

A simple Answerfile.

<?xml version="1.0"?>
<installation>
    <keymap>en-us</keymap>
    <primary-disk>sda</primary-disk>
    <guest-disk>sdb</guest-disk>
    <root-password>StrongPassword</root-password>
    <source type="url">http://fqdn-or-ip/xcp/76/</source>
    <admin-interface name="eth0" proto="dhcp" />
    <timezone>America/New_York</timezone>
</installation>

 

Install - Physical Media

XenServer installation overview.

All hosts have at least one IP address associated with them. To configure a static IP address for the host (instead of using DHCP), have the static IP address and hostname on hand before beginning this procedure.

To install the XenServer host:

  1. Burn the installation files for XenServer to a CD or use a USB boot drive
  2. Back up data you want to preserve. Installing XenServer overwrites data on any hard drives that you select to use for the installation.
  3. Insert the installation CD into the DVD drive of the host computer.
  4. Restart the host computer.
  5. Boot from the DVD drive or USB
  6. Following the initial boot messages
  7. Select Ok to do a clean installation.
  8. If you have multiple hard disks, choose a Primary Disk for the installation. Select Ok.

Choose which disks you want to use for virtual machine storage. Choose Ok.

  1. Set up the management interface to use to connect to XenCenter.
  2. Configure the Management NIC IP address with a static IP address
  3. Specify the hostname and the DNS configuration
  4. Follow the remaining installation screens
  5. Select Install XenServer.
  6. From the Installation Complete screen, eject the installation CD from the drive, and then select *Ok to reboot the server.
  7. Finish configuration using XenCenter
    1. Apply latest patches
    2. Create new pool
    3. Configure Networking
    4. Join other nodes to pool

Networking

Command line tools for XenServer host networking.

Master

Slave

Reset slave host networking

xe-reset-networking --mode= static --ip=$ip --netmask=$mask --gateway=$gateway --dns=$dns --master=$masterip

Pool

Storage Repositories

New local SR

xe sr-create host-uuid=<uuid> content-type=user name-label="<name>" \  shared=false device-config:device="</dev/disk/by-id/device>" type=ext

 

Fixes

Fix the Command not permitted while global/metadata_read_only is set message when removing lvm partitions or pv.

pvremove /dev/sda --config global{metadata_read_only=0}

VM Networking

Change Network

xe vm-list
Copy the uuid for the VM you want to remove the interface.
xe vif-list vm-uuid=<vm-uuid>
Copy the uuid for the vif you want to destroy.
xe vif-destroy uuid=<vif-uuid>
Note you will need to know which device you want to remove if there is more than one interface attached to the VM.
Add:

xe network-list ( "name-label=<label>" )
Copy the networks uuid.
xe vif-create network-uuid=<network-uuid> vm-uuid=<vm-uuid> device=0

Assign IP addressing to VM

xe vm-param-set uuid=8bc00eab-9f3e-4e9c-c7bb-f01dfabc758d xenstore-data:vm-data/ip=10.10.0.89 xenstore-data:vm-data/netmask=255.255.255.0 xenstore-data:vm-data/gateway=10.10.0.2 xenstore-data:vm-data/dns=10.10.0.3

 

ZFS

If you do this, you will break something. DO NOT run production on this SR. If you do, I hope you trust your backups.

Install/enable ZFS on your hosts

On each host that you want to run ZFS:

yum install --enablerepo="xcp-ng-extras" blktap vhd-tool

Install ZFS packages built for XCP-ng: (check version)

yum install --enablerepo="xcp-ng-extras" kmod-spl-4.4.0+10 kmod-zfs-4.4.0+10 spl zfs

Enable the module with

depmod -a && modprobe zfs.

Create a new ZFS pool:

Create the new SR.

Disable sync.

zfs set sync=disabled tank