How to take copy of a VDI if xe vdi-copy doesn't work

How to take copy of a VDI if xe vdi-copy doesn't work

book

Article ID: CTX217769

calendar_today

Updated On:

Description

This article will help in case of VHD issues and want to take a backup of VDI if the command xe vdi-copy doesn't work. This is an advanced tutorial and execute the command with care


Instructions

  1. Create a new VDI as of the same size of the source VDI

 

  1. Make sure the LV for the VDI are active by running

 

#lvchange -ay /dev/VG-XenStorage-SR-UUID/VHD-VDI-UUID

 

  1. Create the tapisk process for those VDI

 

Source 

 

#tap-ctl create -a vhd:/dev/VG-XenStorage-SR-UUID/VHD-VDI-UUID -d /dev/xen/blktap-2/tapdev2 

 

Dest: 

 

#tap-ctl create -a vhd:/dev/VG-XenStorage-SR-UUID/VHD-VDI-UUID -d /dev/xen/blktap-2/tapdev3 

 

  1. Confirm with fdisk -l /dev/xen/blktap-2/* 

 

  1. Perform the dd operation to perform block level copy

 

do the dd using: 

 

# dd if=/dev/xen/blktap-2/tapdev2 of=/dev/xen/blktap-2/tapdev3 bs=1M iflag=direct oflag=direct 

 

 

  1. Once copied, you need to close the tap disk connection to both the source and destination: 

 

   #tap-ctl list (will show you the pid and the minor number) 

   #tap-ctl close -p id -m   (for both source and set)