Skip to content

VM Migrate: VAP-to-Prox

The high level process of migrating windows VMs from VAP to PRX


VAP

GUI - Stop VM (possible from within VM)

Log into the windows console and click shutdown (unless the VM is not sharing an environment with other nodes that are not being migrated)

Get VM Config information

You will need to re-create the VM (with the allocated resources) in the proxmox cluster - CPU - Memory - Network

Get VM ID

You will need the VM id of the VM for later using prlctl list -a | grep CTID prlctl list


Pure Storage

Clone VAP VZ volume

Copy the source volume (probably smhn01_vz) to a new volume smhn01_migrate Attach the volume to a proxmox node (where the skeleton/donar VMs are created). pure copy


Proxmox

Cluster UI

Donar VM

  1. Create a donar/skeleton VM in the GUI that has the same resource allocations as found on the source VM (in VAP)
  2. Remove the automatically added default drive device whilst configuring the skeleton.
  3. Once created, take not of the

Physical Node

Log into the proxmox node to which you have attached the disk

Attach cloned volume

  1. Rescan iscsi bus with iscsiadm -m session --rescan
  2. Check that the device has been found with lsblk
  3. Check that the device has been claimed by multipath with multipath -l (take note of its mapper name i.e. /dev/mapper/mpathb)
  4. Inform LVM to look for new physical volumes with pvscan and confirm with pvdisplay
  5. Inform LVM to resize the device if necessary with pvresize /dev/mapper/mpathb
  6. Inform LVM to check for the new volume group with vgscan and confirm with vgdisplay pure (the vg is probably name pure from the source)
  7. Inform LVM to enable the logical volume that should now be available from the volume group with lvchange -ay /dev/pure/puredata (or whatever name the lv has from the source)
  8. Mount the lv to the temporary path with mount /dev/pure/puredata /mnt/import (create /mnt/import if it does not exist with mkdir /mnt/import)

You should now be able to work with files from within that volume.

Disk Import

Get the name of the target storage pool with pvesm status

It's probably PureStorage-1

Configure the import of the volume as a disk to a vm

qm importdisk [VMID] /mnt/import/vmprivate/[vm_uuid]/hardisk1.hdd [storage_name]
# Example
qm importdisk 163 /mnt/import/vmprivate/091df7ae-fb69-4fde-a53a-448685155dcf/harddisk1.hdd PureStorage-1
Where vm_uuid is the uuid from the output of the prlctl list -a | grep CTID step on the VAP node earlier.

*Repeat the import for all disks (if there are more than one.)

Cluster GUI

VM Hardware

Configure Disk Type

VM Settings - Hardware Modify the newly added disk device/s (should be at bottom of VM hardware list) Configure the following settings - iscsi disk type - ssd enabled - discard enabled

Configure Boot order

VM Settings - Options There should now be a disabled iscsi disk in the boot order options. Enable it and drag it to the top.

Attach VirtIO guest CD

VM Settings - Hardware Attach the virtio drivers disk to the VM's CD rom.

Start the VM

You can now start the VM


VM Console

*If a discoverable on network option is displayed, click NO

Install Guest Tools

Go to CD ROM (explorer) and run and install the guest-tools x64 msi package in the root of the CD ROM A reboot will be required

Configure Network Interfaces

Configure the network interfaces with the allocated IP addresses


Cluster GUI

VM Hardware

Disconnect virtio CD ROM

VM Settings - Hardware You can now modify the CD ROM device and select do not use any media for the CD ROM


Post Migration

Prox CLI

Unmount /tmp/import

You need to exit the temporary mounted folder, and unmount it.

cd ~
umount /tmp/import # Wait a while for this to complete

Remove LVM config

You will now need to disable the lvm logical volume. Run an lsblk to double check which /dev/mapper/mpathX device your volume to be removed is attached too THIS SHOULD BASICALLY NEVER BE mpatha

lvchange -an /dev/pure/puredata
vgchange -an pure
lvremove /dev/pure/puredata
vgremove pure
pvremove /dev/mapper/mpathb # In this example, we're assuming that the volume was identified as mpathb

Remove multipath config

As above, we are assuming that the temporary volume was attached as mpathb

multipath -f mpathb

Remove iscsi paths

Assuming that the output of your lsblk indicated that the mpathb device was made up of /dev/sdg,/dev/sdh,/dev/sdi & /dev/sdj, you can remove the block device paths.

echo 1 | tee /sys/block/sdg/device/delete
echo 1 | tee /sys/block/sdh/device/delete
echo 1 | tee /sys/block/sdi/device/delete
echo 1 | tee /sys/block/sdj/device/delete

Pure GUI

You can now disconnect and remove the temporary pure volume from the host

Prox CLI

Optional You can now re-run a iscsiadm -m session --rescan to ensure that no other paths are attached.


Caveats

Broken SMHN01 volume

Issue with smhn01 requires increasing the volume to like 30TB before scanning it. The pvscan + pvresize

pvscan
pvdisplay 
# Get PV name from output
pvresize <pv_name>
# No need to resize the vg/lv for the import process. This is just to fix the mounting issues