How to export / import VMs from CLI?
How to export / import VMs from CLI? How to export / import VMs from CLI?
This document was published at: http://kb.xensource.com/entry.jspa?externalID=164&categoryID=14
How to export / import VMs from CLI?
Author: Guest, Created on: Feb 1, 2007 1:59 AM
Summary
The XenServer product family has an export and import feature for XenVMs, which can be used to keep a backup of your virtual machines or a means of transferring them from one XenServer Host to another.
The export option will save the XenVM components to a location specified by you, within the Administrator Console machine. You can import the XenVM on any XenServer Host.
You can export/import the XenVMs from one XenServer host to another, using both Administrator Console and CLI (Command Line Interface).
Following steps explains how to export/import VMs from CLI using 'xe' command.
Procedure
Let us assume, you have two hosts 'host1' & 'host2'. You want to export the XenVM from 'host1' & import it to 'host2'.
In following steps we will export the XenVM from 'host1' to a directory on 'host2'. You need to have the free space on 'host2' equivalent to disk size of XenVM to be exported. For this you can add LV & mount it to a directory where the exported VM's data will be copied, refer to "http://kb.xensource.com/entry!default.jspa?categoryID=14&externalID=58" for more help on this. Let us assume you create a LV & mount it under '/mnt/vm_export' directory.
1. Shutdown the VM to be exported on 'host1'. To do so you can use following command from 'host1' CLI.
# xe vm-shutdown vm-name=
2. On 'host2' command prompt run following command to export VM from 'host1' to local directory '/mnt/vm_export' .
# xe vm-export -h
(
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', run below command on 'host2' command prompt.
# xe vm-import -h
The time taken to import depends upon the size of exported XenVM.
User login
Who's new
- Rullydery
- eagenorce
- rittaarier
- swasseZex
- gaterfoko