1

I have two xen servers, 6.5 and xencenter 7.0. They are with OVH and since they don't offer dynamic IP sharing between the machines I guess it makes no sense to add them into a pool? Anyway that's not the question, just clarification.

I want to copy a VM from one server to the other but the xencenter wizard only offers to move the VM - i.e. automatically deletes it from the source machine upon succesfull completion. I want to keep the both, is there a way? Possibly on the CLI?

PART 2

I was able to create a snapshot and from there create an .xva file. (oddly enough the documentation suggest this is an old format and .ova should be used, but the CLI offers no way to do this directly, it can only create .xva files).

I now moved this .xva file to another host, via an NFS share, and ran the importer:

xe vm-import filename=filename.xva

The odd thing is while it now appears in my list of VM's on the new host, the storage still appears to be on the NFS share, two .vhd files corresponding to the virtual disks used by the VM.

So the new question now is: Somehow these .vhd files must be imported to the host, right? But how? Some

Dokbua
  • 1,052
  • 1
  • 9
  • 18

1 Answers1

1

You can use the command line to copy a VM (virtual machine image, in XenCenter speak) between shared SRs (storage repositories)...

you'd need to shut the VM down first (it can't be running) and then something along the lines of

xe vm-list 

To get the name or uuid that will uniquely identify the VM you want to copy and

xe sr-list

if you want to copy it to a different SR (else it will be in the same one) and then

xe vm-copy new-name-label=<whatever-name-you-like> vm=<current-vm>

Where is the name or UUID from the vm-list commmand. This is how it worked in 6.5 for me, I can't say it's the same in your environment, I'd encourage you to look at the command line reference docs at citrix for 7.0 and 6.5

quadruplebucky
  • 5,041
  • 18
  • 23
  • Thanks for the reply. Would it not be possible to clone it instead of copy it, and thus avoid the downtime? After the copy I suppose the copied VM will appear in Xencenter, and from there can be moved to the second hardware node (what is the correct terminology in Xenserver speak?) – Dokbua Jun 11 '17 at 15:51
  • You can almost certainly snapshot a running VM and restore that VM to a different node. What implications that has for your service I can't possibly say, but that's a fairly common backup (DR) strategy. I'd practice this a few times on stuff that doesn't matter if I were you... – quadruplebucky Jun 11 '17 at 17:57