[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [virt-tools-list] Usage of virt-clone

Hi Cole,

thanks for your answer! This looks very nice and sounds logic but doesn't work. :(
I have updated my libvirt to version 0.8.1 on both sides.

Then I have done the following on the SERVER:
virsh pool-define-as blubb --type dir  --target /image
virsh pool-start blubb
virsh pool-autostart blubb

And it looks like:
virsh pool-list --all
Name                 State      Autostart
blubb                active     yes 

Then I dow the following on the SLAVE:
virt-clone --connect xen+tcp://server/ --original blubb --name kopievonblubb
--file /image/kopievonblubb.img
ERROR    [Errno 2] Datei oder Verzeichnis nicht gefunden: '/image/blubb.img'

I think he does not find the Pool. I have read with virt-install i can say "--disk vol=blubb" but virt-clone expect "--file". I have look around the web find nothing helpfull like a Howto to clone images on a remote host. :(

I tell you all I do, maybe there is a mistake...

On the SERVER is a mountet folder called "/images". I defined it as a pool, described above.
On the SLAVE I have an xml file for a guest looks like:
<domain type='xen'>
    <boot dev='cdrom'/>
    <interface type='bridge'>
      <source bridge='tmpbridge'/>
      <mac address='00:16:3e:00:00:01'/>
      <script path='vif-bridge'/>
    <disk type='file' device='disk'>
      <driver name='file'/>
      <source disk='/image/blubb.img'/>
      <target dev='hda'/>
    <disk type='file' device='cdrom'>
      <source file='/image/blubb.iso'/>
      <target dev='hdc'/>
    <graphics type='vnc'  autoport='yes'/>
    <input type='tablet' bus='usb'/>

On the SLAVE I define this VM like:
virsh --connect xen+tcp://server/ define blubb.xml

And then I want to clone this VM like decribed above.

Hope somebody can help :)

Regards , Jessica

2010/7/15 Cole Robinson <crobinso redhat com>
On 07/15/2010 06:14 AM, Bla Blubb wrote:
> Hi,
> I want to use libvirt to manage my Xen-Server and have some questions.
> I have one SERVER with libvirt-bin (from the Debian Lenny
> Repository), Xen 3.1. All the images of Xen determine in /image.
> Then I have an SLAVE with libvirt-bin (from the Debian Lenny
> Repository).
>>From this SLAVE I want to start / stop and clone my virtual machines on
> SERVER. I figured out to place the configuration files on the SLAVE to start
> / stop the virtual machines on the SERVER.
> Now I want to clone a defined VM:
> virt-clone --connect xen+tcp://server/ --original blubb --name kopievonblubb
> --file /image/kopievonblubb.img
> ERROR    [Errno 2] Datei oder Verzeichnis nicht gefunden: '/image/blubb.img'
> I want to clone the VM on the SERVER and place the clones Image on the
> SERVER in the /image folder.
> Does this cloning not working on remote hosts? Or have I a mistake or is the
> version of libvirt to old?

The version of libvirt on the both hosts is too old. You need at least
libvirt 0.6.4, and virtinst 0.500.0 or later IIRC. Then you need to make
sure that your storage is part of a libvirt storage pool (basically make
/image on the server a libvirt directory pool: virsh pool-define-as
--type dir --target /images)

- Cole

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]