My xen goto guy said he only knew to do the export from the windows xen center. This would have meant pulling 150GB through a 100Mbps network twice and I just didn't want to deal with that.
After a few weeks I found this post here:
************************************
Hi,
You can use the the CLI commands to achieve this. Please follow the below procedure :
1. On "host1", shut down the XenVM to be exported, either using Admin console or CLI
# xe vm-shutdown vm-name=<vm_name>
2. On 'host2' execute the following command to export VM from 'host1' to local directory '/mnt/vm_export' .
# xe vm-export -h <ip of host1> -u root -pw <root password of
host1> vm-name=<vm_name> dir-name=/mnt/vm_export/debian
( <vm_name> is name of XenVM on 'host1' you want to export.)
The above command will create the directory /mnt/vm_export/debian &
export the VM from 'host1' to it. The time taken to export depends upon
the size of XenVM.
3. Now to import it to 'host2', execute the below command on 'host2'
# xe vm-import -h <ip of host2> -u root -pw <root password of host2> dir-name=/mnt/vm_export/debian
Just
make sure that you have sufficient free space on host2 ( equivalent to
disk size of XenVM to be exported ). For this you can add an LV &
mount it to a directory where the exported VM's data will be copied.
*********************************
My situation was that I had a 500 GB sata with xen express 3.2 - and an old buggy windows vm that would no longer boot execpt in safe mode - which wouldn't allow connecting via terminal services and I was unable to get the whole c: drive sharing to work. Working through xen center was unbearably slow. So it was suggested that I export from 3.2 and import to 4.01... or be able to mount the vm as a file system from 4.01 if nothing else.
WARNING: The commands below are typed from memory and not pasted and not tested by me in this precise syntax. So study before you repeat what I did and always have a pristine repeatable backup for anything and everything that you can go back to.
I added a new 500 GB drive to my 3.2 system and brought it up. Used fdisk /dev/sdb and created a new primary partition (1) using all space, for a type 83, w to write, q to exit.
mke2fs -j /dev/sdb
mkdir /xen4
mount -t ext3 /dev/sdb /xen4/adlvm
xe vm-export host=localhost -u root -pw myrootpass vm-name=my_vm_name dir-name=/xen4/adlvm
It's still processing step 1 of 152 steps... I'll update this post once I get further.
**************** 36 hours pass by *********************
The processing of 152 steps is successful. During that time at about step 35 I may have plugged or unplugged something from a USB jack on the machine. This may have caused a message to appear on the console such as "assume write-through cache." I googled it and found it caused no harm and was informational. The processing continued without intervention. Because each step takes so long, I wouldn't really have known if it was still going.
Next I powered down. Removed the Xen 3.2 drive and attached the Xen 4.01 drive. I guess all this isn't necessary unless you want to preserve the ability to go back to what you had that may work ... since it is possible supposedly to upgrade the 3.2 to 4.01 with the cd.
I mounted my separate drive that contained the exported vm:
mount -t ext3 /dev/sdb /xen4
The syntax for importing has changed between 3.2 and 4.01 dramatically. Also the way the 3.2 stored the export is not in one file but in many chunks in a dir named hda, and on that same level an xml file. Eventually I found the 4.01 documentation online, and this section giving the "vm" commands for xe:
http://docs.xensource.com/XenServer/4.0.1/reference/ch05s04.html#cli-xe-commands_vm
Here is the import command I used:
xe vm-import filename=/xen4/adlvm
There's no indication of progress on my screen - but then it could be slightly off to the left... I'm using a weird monitor where I can't see all the way to the left. No, there really isn't any way to fix it - it's borken... I could hook up a different one.
Note on the above 4.01 manual it says that I won't have any network interface in the imported vm using this method. (EERRRK???) And "if you need one" use vif-create and vif-plug. That syntax can be found here:
http://docs.xensource.com/XenServer/4.0.1/reference/ch05s04.html#cli-xe-commands_vif
I'd be happy if I could just read my files... mount this exported vm as a file system so I could get at my files at a decent speed. I've heard this is possible in 4.01 ... but I don't know if I have to first import it.
Will update when the import finishes....
|
|
|||||||
|
Search
Categories
Recent Photos
Recent Visitors
Cristian - Thu 19 Feb 2009 01:10 AM PST
April Lorenzen - Fri 11 Apr 2008 08:31 AM PDT
kitchen - Wed 23 May 2007 11:00 PM PDT
Al Turtle - Fri 24 Mar 2006 04:52 PM PST
Lelain - Sun 19 Feb 2006 10:17 PM PST
Recent Entries
Recent Comments
This Month
Month Archive
Login
|
Export a Xenserver 3.2 vm using Linux command line interface
Comments
No comments found.
Trackbacks
TrackBack URL: |
||||||
|
|
|||||||