Jump to content
Welcome to our new Citrix community!
  • 0

Problems importing VHD file to VDI through CLI


Simon Demuynck

Question

Hello all!
I am a student at HOWEST Belgium studying Multimedia and Creative Technologies as IOT and Infrastructure engineer and was given the assignment to research the migration from vSphere to Citrix Xencenter.

 

I have successfully managed to import vSphere machines to Xencenter using the GUI, but I am struggling to automate things through the CLI.
I'm trying to import a VHD file to my newly created VM's VDI (which was made through the CLI)
I've given the VDI 25GB which is more than sufficient for the 12GB VHD upload i want to import.

I have tried the following;

 

  1.  Using the xe vm-install template="Ubuntu Bionic Beaver 18.04" new-name-label="Ubuntu-CLI" command to create a virtual machine
    1. xe vdi-resize uuid=3498dc9a-da28-485f-b11f-a8285ae0099e disk-size=25GiB resizing it to 25GB
    2. xe vdi-import uuid=d49da951-4560-4a4b-b86b-4811ba6772a2 filename=/mnt/VMDKShare/UbuntuVM-1.vhd format=vhd --progress to import my own VHD (converted from vSphere VMDK)
      1. resulting in the following error: image.thumb.png.31923f4b15a5af656d6ce9a1ec7f2244.png
  2.  Using the xe vm-install template="Ubuntu Bionic Beaver 18.04" new-name-label="Ubuntu-CLI" command to create a virtual machine
    1. Removing the disk through the GUI
    2. Adding a new disk with xe vdi-create sr-uuid=e7870991-edf0-c489-c6cd-c7c1ea6afb93 name-label=UbuntuVM_Disk1 type=system virtual-size=25000000 3af2f10b-6ad3-da15-1a32-d3102d791412
    3. Uploading my own VHD again with xe vdi-import uuid=d49da951-4560-4a4b-b86b-4811ba6772a2 filename=/mnt/VMDKShare/UbuntuVM-1.vhd format=vhd --progress to import my own VHD (converted from vSphere VMDK)
      1. resulting in the same error: image.thumb.png.31923f4b15a5af656d6ce9a1ec7f2244.png
  3. Tried to import a VMDK, OVF or VHD file through the cli with xe vm-import filename=/mnt/VMDKShare/Win10-TestVM.vmdk sr-uuid=e7870991-edf0-c489-c6cd-c7c1ea6afb93
    1. Resulting in the following error: image.thumb.png.c47375a457f6129efe0a43733f06a22f.png
  4. Created a Virtual Machine through the GUI with the VMDK import, booting perfectly fine, finding the VHD file coupled to the VDI, removed the VDI and copied my own VDI and pasted it in the same directory with the same UUID. This just failed to boot the VM..
    1. image.thumb.png.98e68d3367b468e2518a0f645c041dc5.png

 

I'm wondering if I'm doing something wrong, am I using the commands wrong? Am I missing parameters?

I'm hoping to hear back from you soon!

 

Kind Regards,

Simon Demuynck

Link to comment

14 answers to this question

Recommended Posts

  • 0

Found a working solution to the problem.
Looks like you can VDI Import a VMDK file with format=raw. the --progress however does not work up until the file is done uploading.

 

Thanks for the support provided to the people that commented on this thread, I can now continue my project and start automating ?

 

Regards,

 

Simon Demuynck

  • Like 1
Link to comment
  • 0

Looks like the Hypervisor is doing some shady stuff.. (same error, more info)

image.thumb.png.bccc6c43f8c24a4202ef3206da0c4f81.png

So for some reason the Hypervisor is closing the transfer connection when trying to create a VM?
I figured out it is running iptables as firewall, but disabling it did nothing.
Any idea why it would do that? And what a possible fix might be?

 

EDIT:
I also tried a converted VMDK to IMG file with qemu-img on the vm-import which prompts the exact same error.

 

Thanks in advance!

 

Simon Demuynck

Link to comment
  • 0
9 hours ago, Simon Demuynck said:

Found a working solution to the problem.
Looks like you can VDI Import a VMDK file with format=raw. the --progress however does not work up until the file is done uploading.

 

Thanks for the support provided to the people that commented on this thread, I can now continue my project and start automating ?

 

Regards,

 

Simon Demuynck

Yeah, I thought importing the VDI separately might be a good option. Glad that worked for you.

-=Tobias

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...