02 October 2016

XenServer: Upgrade and Restore VMs

I recently carried out a destructive XenServer upgrade, and an in-place one. This are my notes for a third kind of situation: where you want to fresh install the XenServer OS but maintain the existing virtual machines.

UPDATE: This failed for me at the point of "Get the SCSI ID of the device/partition":

Pre-Install

You need to preserve the VM meta data on a different disk to that containing the OS.

  1. Find the disk partitions to find a suitable candidate (lowercase L parameter):
    fdisk -l
    Look for /dev/mapper/XSLocalEXT... or similar (i.e. not dev/sda)
  2. List the mount points to find where it's mounted:
    df -h
    Look for "Mounted on" .../run/sr-mount/87e9a...
  3. Check that tallies with the XenServer VHD list:
    xe sr-list
  4. Create the backup on that disk:
    xe-backup-metadata -c -u87e9a25f...

Post-Install

  1. Find the key:
    pvscan
    Look for: PV /dev/sdb   VG XSLocalEXT-87e9a2...
  2. Re introduce the storage:
    xe sr-introduce uuid=39baf126... type=lvm name-label="Local storage" content-type=user
  3. Get the SCSI ID of the device/partition where the SR is:
    ls -l /dev/disk/by-id/
  4. Get the host UUID:
    xe host-list
  5. Create a PBD (physical block device) to link XenServer and the SR:
    xe pbd-create sr-uuid=87e9a25f... device-config:device=/dev/disk/by-id/scsi-3600... host-uuid=3ca23...

Other Tasks

  • SSH Keys: Setup any SSH keys you need
  • ISO Share: Re-set up your ISO share, if like mine it used the remaining space on the OS drive.
  • Salt-Minion: Reinstall and configure any configuration manager.

No comments:

Post a Comment