Re: [libvirt-users] snapshot of running vm's

2015-12-04 Thread Lentes, Bernd
Dominique wrote:
> 
> Never had that problem. Can it be a setting of the guest agent on the
> guest? With me all the commands of the ga are enabled...
> 
Where can i change the settings of the agent ?

> You can check the commands by using this:
> virsh qemu-agent-command $VM '{"execute": "guest-info"}'
> 
> This way you can at least check that the command is really disabled.
You'll
> have to find a way to enable the command then...
> 
> I can't help you further with this...
> 
> >
> > I managed to update to libvirt 1.2.11. Guest Agent is running in the
vm.
> > I'm trying to snapshot:
> >
> > virsh # snapshot-create-as --domain sles11 --name sn_sles11 --atomic
> > --disk- only --quiesce
> > error: internal error: unable to execute QEMU agent command
> > 'guest-fsfreeze-freeze': The command guest-fsfreeze-freeze has been
> > disabled for this instance
> >
> > What is now going on ?
> > Guest Agent in VM is qemu-guest-agent-2.0.2-1.35.
> >

virsh # qemu-agent-command sles11 '{"execute": "guest-info"}'

{"return":{"version":"2.0.2","supported_commands":[{"enabled":true,"name":
"guest-set-vcpus","success-response":true},{"enabled":true,"name":"guest-g
et-vcpus"
,"success-response":true},{"enabled":true,"name":"guest-network-get-interf
aces","success-response":true},{"enabled":true,"name":"guest-suspend-hybri
d","succe
ss-response":false},{"enabled":true,"name":"guest-suspend-ram","success-re
sponse":false},{"enabled":true,"name":"guest-suspend-disk","success-respon
se":false
},{"enabled":true,"name":"guest-fstrim","success-response":true},{"enabled
":true,"name":"guest-fsfreeze-thaw","success-response":true},
{"enabled":true,"name":"guest-fsfreeze-freeze","success-response":true}
,{"enabled":true,"name":"guest-fsfreeze-status","success-response":true},{
"enabled":true,"name":"guest-file-
flush","success-response":true},{"enabled":true,"name":"guest-file-seek","
success-response":true},{"enabled":true,"name":"guest-file-write","success
-response
":true},{"enabled":true,"name":"guest-file-read","success-response":true},
{"enabled":true,"name":"guest-file-close","success-response":true},{"enabl
ed":true,
"name":"guest-file-open","success-response":true},{"enabled":true,"name":"
guest-shutdown","success-response":false},{"enabled":true,"name":"guest-in
fo","succ
ess-response":true},{"enabled":true,"name":"guest-set-time","success-respo
nse":true},{"enabled":true,"name":"guest-get-time","success-response":true
},{"enabl
ed":true,"name":"guest-ping","success-response":true},{"enabled":true,"nam
e":"guest-sync","success-response":true},{"enabled":true,"name":"guest-syn
c-delimit
ed","success-response":true}]}}

It shows:
"...{"enabled":true,"name":"guest-fsfreeze-freeze","success-response":true
}

It understand this that it should work.


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

___
libvirt-users mailing list
libvirt-users@redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-users


Re: [libvirt-users] snapshot of running vm's

2015-12-03 Thread Lentes, Bernd
Dominique wrote:

> -Original Message-
> From: Dominique Ramaekers
> [mailto:dominique.ramaek...@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.len...@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:
> >
> > 
> >>
> path='/var/lib/libvirt/qemu/channel/target/sles11.org.qemu.guest_age
> nt
> > .0'/
> > >
> >   
> >   
> > 
> >
> >
> > I didn't insert the path, it was added automatically, the same with
> > "".
> > 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

___
libvirt-users mailing list
libvirt-users@redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-users


Re: [libvirt-users] snapshot of running vm's

2015-12-02 Thread Lentes, Bernd
Dominique wrote:

> -Original Message-
> From: Dominique Ramaekers
> [mailto:dominique.ramaek...@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-boun...@redhat.com [mailto:libvirt-users-
> > boun...@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 
>
> 
> 
> 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...)
> 
> 
> 
> 
> >
> > 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
> > version
> You'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) ?

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

___
libvirt-users mailing list
libvirt-users@redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-users


Re: [libvirt-users] snapshot of running vm's

2015-12-02 Thread Lentes, Bernd
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 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 
>
> 
> 
> 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...)
> 

Hi,

i have inserted:


  
  
  



I didn't insert the path, it was added automatically, the same with
"".
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

___
libvirt-users mailing list
libvirt-users@redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-users


Re: [libvirt-users] snapshot of running vm's

2015-12-02 Thread Dominique Ramaekers


> -Oorspronkelijk bericht-
> Van: libvirt-users-boun...@redhat.com [mailto:libvirt-users-
> boun...@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

   
   


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...)




> 
> 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 version
You'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.len...@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@redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-users

___
libvirt-users mailing list
libvirt-users@redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-users