Hi, i'd like to create snapshots of my running vm's. I have several hosts with SLES11 SP4 64bit. I use libvirt 1.2.5-7.1 . VM's are Windows 7, SLES, Ubuntu, Opensuse. I use raw files for the vm's. I try to orientate myself by http://wiki.libvirt.org/page/Live-disk-backup-with-active-blockcommit . The hosts are backuped every night by a network based backup solution (Legato). My idea is: - delete any existing snapshot - create a new snapshot - of course before Legato arrives - then Legato might come and saves my snapshot - next night the same Questions: When I delete a snapshot, is it merged automatically with its base image ? Or is it something I have to do explicitly (maybe via blockcommit) ? How can I get rid of the unused snapshot afterwards ? just rm ? Because I'm doing a live backup do I need to create an external snapshot ? To create an external snapshot do I have to provide --disk-only ? Do I have to provide --live as a parameter ? I tried --quiesce but got that message: virsh # snapshot-create --domain sles11 --atomic --disk-only --quiesce error: argument unsupported: QEMU guest agent is not configured The system I'm testing with is SLES11 SP4 (host and guest). I installed the guest agent: vm58820-8:~ # rpm -q qemu-guest-agent qemu-guest-agent-2.0.2-1.35 Is there something I have to configure ? Is this way of backup a good solution ? Is there something to improve, something I have to take care of ? Is this backup consistent ? Does that all work with libvirt 1.2.5-7.1 or do I need a more recent version (what I don't like because I tried already to update my libvirt but had tons of dependencies) ? I know. A lot of questions. But it's a backup, and I wanted to be sure that it operates properly. Thanks. Bernd -- Bernd Lentes Systemadministration institute of developmental genetics Geb?ude 35.34 - Raum 208 HelmholtzZentrum M?nchen bernd.lentes at helmholtz-muenchen.de phone: +49 (0)89 3187 1241 fax: +49 (0)89 3187 2294 Wer Visionen hat soll zum Hausarzt gehen Helmut Schmidt Helmholtz Zentrum Muenchen Deutsches Forschungszentrum fuer Gesundheit und Umwelt (GmbH) Ingolstaedter Landstr. 1 85764 Neuherberg www.helmholtz-muenchen.de Aufsichtsratsvorsitzende: MinDir'in Baerbel Brumme-Bothe Geschaeftsfuehrer: Prof. Dr. Guenther Wess, Dr. Nikolaus Blum, Dr. Alfons Enhsen Registergericht: Amtsgericht Muenchen HRB 6466 USt-IdNr: DE 129521671
> -----Oorspronkelijk bericht----- > Van: libvirt-users-bounces at redhat.com [mailto:libvirt-users- > bounces at redhat.com] Namens Lentes, Bernd > Verzonden: dinsdag 1 december 2015 16:31 > Aan: libvirt-ML > Onderwerp: [libvirt-users] snapshot of running vm's > > Hi, > > i'd like to create snapshots of my running vm's. I have several hosts with > SLES11 SP4 64bit. I use libvirt 1.2.5-7.1 . VM's are Windows 7, SLES, Ubuntu, > Opensuse. > I use raw files for the vm's. > I try to orientate myself by > http://wiki.libvirt.org/page/Live-disk-backup-with-active-blockcommit . > The hosts are backuped every night by a network based backup solution > (Legato). > My idea is: > > - delete any existing snapshot > - create a new snapshot > - of course before Legato arrives > - then Legato might come and saves my snapshot > - next night the same > > > Questions: > When I delete a snapshot, is it merged automatically with its base image ?No> Or is it something I have to do explicitly (maybe via blockcommit) ?When using external snapshots, the procedure works like this: 1. Create external snapshot => a new file is created ex. 'image.qcow2' 2. Backup the original file ex. 'image.raw' (this file wil not change over time. All writes are done on image.qcow2). 3. Active block commit (commits all writes done on image.qcow2 to image.raw and activate image.raw) 4. delete image.qcow2 If you do a test, you can check which file is in use by 'virsh domblklist $VM'> How can I get rid of the unused snapshot afterwards ? just rm ? > Because I'm doing a live backup do I need to create an external snapshot ? > To create an external snapshot do I have to provide --disk-only ?Yes. And it's advisible to also use --quiesce to flush the guests disk cache (the guest agent needs to be installed and running on the guest) And optional use --no-metadata to make shure libvirt isn't following up on these snapshots. This way you can just remove the image.qcow2 with rm> Do I have to provide --live as a parameter ?Yes, the snapshot is done on a live guest/disk> I tried --quiesce but got that message: > > virsh # snapshot-create --domain sles11 --atomic --disk-only --quiesce > error: argument unsupported: QEMU guest agent is not configured The system > I'm testing with is SLES11 SP4 (host and guest). I installed the guest agent: > > vm58820-8:~ # rpm -q qemu-guest-agent > qemu-guest-agent-2.0.2-1.35 > Is there something I have to configure ?Yes, you have to update the guest xml with 'virsh edit $VM' and enter these lines in the devices section <channel type='unix'> <source mode='bind'> <target type='virtio' name='org.qemu.guest_agent.0'/> </channel> After this, it's possible the qemu guest agent is still not working, edit the xml again and change the port number in the line to a free port (you'll see that for example spice is using the same controller, bus and port...) <address type='virtio-serial' controller='0' bus='0' port='1'/>> > Is this way of backup a good solution ? Is there something to improve,This way you backup disk state. Most of the times this will be great. For some applications, this isn't sufficient. For instance, a Autodesk Vault Server has a SQL database and a separate file storage. Using Active block commit to backup will not guarantee data concistancy. That's why Autodesk has its own 'best practice'. Here I initiate the Autodesk procedure through a powershell script (I connect to the guest with telnet).> something I have to take care of ? > Is this backup consistent ? > Does that all work with libvirt 1.2.5-7.1 or do I need a more recent versionYou'll need libvirt 1.2.9 or more and Qemu 2.1 (with higher qemu's I have experienced some trouble...)> (what I don't like because I tried already to update my libvirt but had tons of > dependencies) ? > > I know. A lot of questions. But it's a backup, and I wanted to be sure that it > operates properly. > > Thanks. > > > Bernd > -- > Bernd Lentes > > Systemadministration > institute of developmental genetics > Geb?ude 35.34 - Raum 208 > HelmholtzZentrum M?nchen > bernd.lentes at helmholtz-muenchen.de > phone: +49 (0)89 3187 1241 > fax: +49 (0)89 3187 2294 > > Wer Visionen hat soll zum Hausarzt gehen Helmut Schmidt > > > Helmholtz Zentrum Muenchen > Deutsches Forschungszentrum fuer Gesundheit und Umwelt (GmbH) > Ingolstaedter Landstr. 1 > 85764 Neuherberg > www.helmholtz-muenchen.de > Aufsichtsratsvorsitzende: MinDir'in Baerbel Brumme-Bothe > Geschaeftsfuehrer: Prof. Dr. Guenther Wess, Dr. Nikolaus Blum, Dr. Alfons > Enhsen > Registergericht: Amtsgericht Muenchen HRB 6466 > USt-IdNr: DE 129521671 > > > _______________________________________________ > libvirt-users mailing list > libvirt-users at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-users
Dominique wrote:> -----Original Message----- > From: Dominique Ramaekers > [mailto:dominique.ramaekers@cometal.be] > Sent: Wednesday, December 02, 2015 1:34 PM > To: Lentes, Bernd; libvirt-ML > Subject: RE: snapshot of running vm's > > > > > -----Oorspronkelijk bericht----- > > Van: libvirt-users-bounces@redhat.com [mailto:libvirt-users- > > bounces@redhat.com] Namens Lentes, Bernd > > Verzonden: dinsdag 1 december 2015 16:31 > > Aan: libvirt-ML > > Onderwerp: [libvirt-users] snapshot of running vm's > > > > Hi, > > > > i'd like to create snapshots of my running vm's. I have several hosts > > with > > SLES11 SP4 64bit. I use libvirt 1.2.5-7.1 . VM's are Windows 7, SLES, > > Ubuntu, Opensuse. > > I use raw files for the vm's. > > I try to orientate myself by > > http://wiki.libvirt.org/page/Live-disk-backup-with-active-blockcommit > . > > The hosts are backuped every night by a network based backup > solution > > (Legato). > > My idea is: > > > > - delete any existing snapshot > > - create a new snapshot > > - of course before Legato arrives > > - then Legato might come and saves my snapshot > > - next night the same > > > > > > Questions: > > When I delete a snapshot, is it merged automatically with its base > image ? > No > > > Or is it something I have to do explicitly (maybe via blockcommit) ? > When using external snapshots, the procedure works like this: > 1. Create external snapshot => a new file is created ex. 'image.qcow2' > 2. Backup the original file ex. 'image.raw' (this file wil not changeover> time. All writes are done on image.qcow2). > 3. Active block commit (commits all writes done on image.qcow2 to > image.raw and activate image.raw) 4. delete image.qcow2 > > If you do a test, you can check which file is in use by 'virshdomblklist> $VM' > > > How can I get rid of the unused snapshot afterwards ? just rm ? > > Because I'm doing a live backup do I need to create an external > snapshot ? > > To create an external snapshot do I have to provide --disk-only ? > Yes. And it's advisible to also use --quiesce to flush the guests diskcache> (the guest agent needs to be installed and running on the guest) And > optional use --no-metadata to make shure libvirt isn't following up on > these snapshots. This way you can just remove the image.qcow2 with rm > > > Do I have to provide --live as a parameter ? > Yes, the snapshot is done on a live guest/disk > > > I tried --quiesce but got that message: > > > > virsh # snapshot-create --domain sles11 --atomic --disk-only --quiesce > > error: argument unsupported: QEMU guest agent is not configured The > > system I'm testing with is SLES11 SP4 (host and guest). I installedthe> guest agent: > > > > vm58820-8:~ # rpm -q qemu-guest-agent > > qemu-guest-agent-2.0.2-1.35 > > Is there something I have to configure ? > Yes, you have to update the guest xml with 'virsh edit $VM' and enter > these lines in the devices section <channel type='unix'> > <source mode='bind'> > <target type='virtio' name='org.qemu.guest_agent.0'/> </channel> > > After this, it's possible the qemu guest agent is still not working,edit the> xml again and change the port number in the line to a free port (you'll > see that for example spice is using the same controller, bus andport...)> <address type='virtio-serial' controller='0' bus='0' port='1'/> > > > > > > > Is this way of backup a good solution ? Is there something to improve, > This way you backup disk state. Most of the times this will be great.For> some applications, this isn't sufficient. > For instance, a Autodesk Vault Server has a SQL database and a separate > file storage. Using Active block commit to backup will not guaranteedata> concistancy. That's why Autodesk has its own 'best practice'. Here I > initiate the Autodesk procedure through a powershell script (I connectto> the guest with telnet). > > > > something I have to take care of ? > > Is this backup consistent ? > > Does that all work with libvirt 1.2.5-7.1 or do I need a more recent > > version > You'll need libvirt 1.2.9 or more and Qemu 2.1 (with higher qemu's Ihave> experienced some trouble...) > > > > (what I don't like because I tried already to update my libvirt but > > had tons of > > dependencies) ?Ok. I have to try.> > > > I know. A lot of questions. But it's a backup, and I wanted to be sure > > that it operates properly. > > > > Thanks. > > > >Hi Dominique, thanks for your very clear and detailed answer. Bernd Helmholtz Zentrum Muenchen Deutsches Forschungszentrum fuer Gesundheit und Umwelt (GmbH) Ingolstaedter Landstr. 1 85764 Neuherberg www.helmholtz-muenchen.de Aufsichtsratsvorsitzende: MinDir'in Baerbel Brumme-Bothe Geschaeftsfuehrer: Prof. Dr. Guenther Wess, Dr. Nikolaus Blum, Dr. Alfons Enhsen Registergericht: Amtsgericht Muenchen HRB 6466 USt-IdNr: DE 129521671
Dominique wrote:> > virsh # snapshot-create --domain sles11 --atomic --disk-only --quiesce > > error: argument unsupported: QEMU guest agent is not configured The > > system I'm testing with is SLES11 SP4 (host and guest). I installedthe> guest agent: > > > > vm58820-8:~ # rpm -q qemu-guest-agent > > qemu-guest-agent-2.0.2-1.35 > > Is there something I have to configure ? > Yes, you have to update the guest xml with 'virsh edit $VM' and enter > these lines in the devices section <channel type='unix'> > <source mode='bind'> > <target type='virtio' name='org.qemu.guest_agent.0'/> </channel> > > After this, it's possible the qemu guest agent is still not working,edit the> xml again and change the port number in the line to a free port (you'll > see that for example spice is using the same controller, bus andport...)> <address type='virtio-serial' controller='0' bus='0' port='1'/>Hi, i have inserted: <channel type='unix'> <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/sles11.org.qemu.guest_agent.0'/><target type='virtio' name='org.qemu.guest_agent.0'/> <address type='virtio-serial' controller='0' bus='0' port='2'/> </channel> I didn't insert the path, it was added automatically, the same with "<address type='virtio-serial' controller='0' bus='0' port='2'/>". I tried already port 1 and 2, but get this error: sunhb58820:~/libvirt_1.2.11 # virsh start sles11 error: Failed to start domain sles11 error: internal error: process exited while connecting to monitor: qemu-kvm: -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/sles11.or g.qemu.guest_agent.0,server,nowait: Failed to bind socket: No such file or directory chardev: opening backend "socket" failed Bernd Helmholtz Zentrum Muenchen Deutsches Forschungszentrum fuer Gesundheit und Umwelt (GmbH) Ingolstaedter Landstr. 1 85764 Neuherberg www.helmholtz-muenchen.de Aufsichtsratsvorsitzende: MinDir'in Baerbel Brumme-Bothe Geschaeftsfuehrer: Prof. Dr. Guenther Wess, Dr. Nikolaus Blum, Dr. Alfons Enhsen Registergericht: Amtsgericht Muenchen HRB 6466 USt-IdNr: DE 129521671
Dominique wrote:> -----Original Message----- > From: Dominique Ramaekers > [mailto:dominique.ramaekers@cometal.be] > Sent: Thursday, December 03, 2015 9:46 AM > To: Lentes, Bernd > Subject: RE: snapshot of running vm's > > > > > -----Oorspronkelijk bericht----- > > Van: Lentes, Bernd [mailto:bernd.lentes@helmholtz-muenchen.de] > > Verzonden: woensdag 2 december 2015 21:22 > > Aan: Dominique Ramaekers; libvirt-ML > > Onderwerp: RE: snapshot of running vm's > > > ... > > > > Hi, > > > > i have inserted: > > > > <channel type='unix'> > > <source mode='bind' > > > path='/var/lib/libvirt/qemu/channel/target/sles11.org.qemu.guest_age > nt > > .0'/ > > > > > <target type='virtio' name='org.qemu.guest_agent.0'/> > > <address type='virtio-serial' controller='0' bus='0' port='2'/> > > </channel> > > > > > > I didn't insert the path, it was added automatically, the same with > > "<address type='virtio-serial' controller='0' bus='0' port='2'/>". > > I tried already port 1 and 2, but get this error: > > > > sunhb58820:~/libvirt_1.2.11 # virsh start sles11 > > error: Failed to start domain sles11 > > error: internal error: process exited while connecting to monitor: > > qemu-kvm: -chardev > > > socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/sles1 > > 1.or > > g.qemu.guest_agent.0,server,nowait: Failed to bind socket: No such > > file or directory > > chardev: opening backend "socket" failed > > Does the path /var/lib/libvirt/qemu/channel/target/ exists? > Is libvirt able to write to this path? >Hi Dominique, no, the path does not exist. But from where does libvirt derive it ? Bernd Helmholtz Zentrum Muenchen Deutsches Forschungszentrum fuer Gesundheit und Umwelt (GmbH) Ingolstaedter Landstr. 1 85764 Neuherberg www.helmholtz-muenchen.de Aufsichtsratsvorsitzende: MinDir'in Baerbel Brumme-Bothe Geschaeftsfuehrer: Prof. Dr. Guenther Wess, Dr. Nikolaus Blum, Dr. Alfons Enhsen Registergericht: Amtsgericht Muenchen HRB 6466 USt-IdNr: DE 129521671
Dominique wrote:> -----Original Message----- > From: Dominique Ramaekers > [mailto:dominique.ramaekers@cometal.be] > Sent: Thursday, December 03, 2015 9:46 AM > To: Lentes, Bernd > Subject: RE: snapshot of running vm's > > > > > -----Oorspronkelijk bericht----- > > Van: Lentes, Bernd [mailto:bernd.lentes@helmholtz-muenchen.de] > > Verzonden: woensdag 2 december 2015 21:22 > > Aan: Dominique Ramaekers; libvirt-ML > > Onderwerp: RE: snapshot of running vm's > > > ... > > > > Hi, > > > > i have inserted: > > > > <channel type='unix'> > > <source mode='bind' > > > path='/var/lib/libvirt/qemu/channel/target/sles11.org.qemu.guest_age > nt > > .0'/ > > > > > <target type='virtio' name='org.qemu.guest_agent.0'/> > > <address type='virtio-serial' controller='0' bus='0' port='2'/> > > </channel> > > > > > > I didn't insert the path, it was added automatically, the same with > > "<address type='virtio-serial' controller='0' bus='0' port='2'/>". > > I tried already port 1 and 2, but get this error: > > > > sunhb58820:~/libvirt_1.2.11 # virsh start sles11 > > error: Failed to start domain sles11 > > error: internal error: process exited while connecting to monitor: > > qemu-kvm: -chardev > > > socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/sles1 > > 1.or > > g.qemu.guest_agent.0,server,nowait: Failed to bind socket: No such > > file or directory > > chardev: opening backend "socket" failed > > Does the path /var/lib/libvirt/qemu/channel/target/ exists? > Is libvirt able to write to this path? >Hi Dominique, no, the path does not exist. But from where does libvirt derive it ? I forgot: I'm still running libvirt 1.2.5. Do I need to update also for this problem ? Bernd Helmholtz Zentrum Muenchen Deutsches Forschungszentrum fuer Gesundheit und Umwelt (GmbH) Ingolstaedter Landstr. 1 85764 Neuherberg www.helmholtz-muenchen.de Aufsichtsratsvorsitzende: MinDir'in Baerbel Brumme-Bothe Geschaeftsfuehrer: Prof. Dr. Guenther Wess, Dr. Nikolaus Blum, Dr. Alfons Enhsen Registergericht: Amtsgericht Muenchen HRB 6466 USt-IdNr: DE 129521671
> -----Oorspronkelijk bericht----- > Van: Lentes, Bernd [mailto:bernd.lentes@helmholtz-muenchen.de] > Verzonden: donderdag 3 december 2015 13:54 > Aan: libvirt-ML > CC: Dominique Ramaekers > Onderwerp: RE: snapshot of running vm's > > > ... > > > > > > Hi, > > > > > > i have inserted: > > > > > > <channel type='unix'> > > > <source mode='bind' > > > > > path='/var/lib/libvirt/qemu/channel/target/sles11.org.qemu.guest_age > > nt > > > .0'/ > > > > > > > <target type='virtio' name='org.qemu.guest_agent.0'/> > > > <address type='virtio-serial' controller='0' bus='0' > > > port='2'/> </channel> > > > > > > > > > I didn't insert the path, it was added automatically, the same with > > > "<address type='virtio-serial' controller='0' bus='0' port='2'/>". > > > I tried already port 1 and 2, but get this error: > > > > > > sunhb58820:~/libvirt_1.2.11 # virsh start sles11 > > > error: Failed to start domain sles11 > > > error: internal error: process exited while connecting to monitor: > > > qemu-kvm: -chardev > > > > > socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/sles1 > > > 1.or > > > g.qemu.guest_agent.0,server,nowait: Failed to bind socket: No such > > > file or directory > > > chardev: opening backend "socket" failed > > > > Does the path /var/lib/libvirt/qemu/channel/target/ exists? > > Is libvirt able to write to this path? > > > Hi Dominique, > > no, the path does not exist. But from where does libvirt derive it ?I think the path is compiled into the binaries. Just create the path and make sure libvirt can write to it root@CmsrvVH3:/var/lib/libvirt/qemu/channel# ls -lh totaal 4,0K drwxr-xr-x 2 libvirt-qemu kvm 4,0K nov 23 20:49 target> > I forgot: I'm still running libvirt 1.2.5. Do I need to update also for this problem > ?I don't think so... Until you want to use active block commit, your good with 1.2.5> > > Bernd > > > > Helmholtz Zentrum Muenchen > Deutsches Forschungszentrum fuer Gesundheit und Umwelt (GmbH) > Ingolstaedter Landstr. 1 > 85764 Neuherberg > www.helmholtz-muenchen.de > Aufsichtsratsvorsitzende: MinDir'in Baerbel Brumme-Bothe > Geschaeftsfuehrer: Prof. Dr. Guenther Wess, Dr. Nikolaus Blum, Dr. Alfons > Enhsen > Registergericht: Amtsgericht Muenchen HRB 6466 > USt-IdNr: DE 129521671