virsh snapshot-create-as fails to create external snapshot (Error from child process creating with name of memory output file)

Asked by Thierry Bouhnik

Hello,

I tried for the first time to create an external snapshot and as I want to do it with vm online, ram must be saved to have a valid backup.

So I typed that:

# virsh snapshot-create-as --domain jeedom —-name jeedom_snap --diskspec vda,snapshot=external,file=/media/ds415play/donnees/Intel\ NUC/VM/jeedom/backup/jeedom_vda_snap.qcow2 --memspec file=/media/ds415play/donnees/Intel\ NUC/VM/jeedom/backup/jeedom_mem_snap.qcow2,snapshot=external --atomic

erreur : Error from child process creating '/media/ds415play/donnees/Intel NUC/VM/jeedom/backup/jeedom_mem_snap.qcow2': Opération non permise

I use Ubuntu 16.04.2 LTS and my versions of libvirt packages :

root@D54250WYK:/home/thierry# dpkg -l | grep "libvirt"
ii gir1.2-libvirt-glib-1.0:amd64 0.2.2-0.1ubuntu1 amd64 libvirt glib mainloop integration
ii libvirt-bin 1.3.1-1ubuntu10.10 amd64 programs for the libvirt library
ii libvirt-glib-1.0-0:amd64 0.2.2-0.1ubuntu1 amd64 libvirt glib mainloop integration
ii libvirt0:amd64 1.3.1-1ubuntu10.10 amd64 library for interfacing with different virtualization systems
ii python-libvirt 1.3.1-1ubuntu1 amd64 libvirt Python bindings

# libvirtd --version
libvirtd (libvirt) 1.3.1

# virsh --version
1.3.1

Dump of my xml config

!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
  virsh edit jeedom
or other application using the libvirt API.
-->

<domain type='kvm'>
  <name>jeedom</name>
  <uuid>******************</uuid>
  <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <os>
    <type arch='x86_64' machine='pc-i440fx-xenial'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  <cpu mode='custom' match='exact'>
    <model fallback='allow'>Haswell-noTSX</model>
  </cpu>
  <clock offset='utc'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <pm>
    <suspend-to-mem enabled='no'/>
    <suspend-to-disk enabled='no'/>
  </pm>
  <devices>
    <emulator>/usr/bin/kvm-spice</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/debian_jessy.qcow2'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </disk>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='virtio-serial' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </controller>
    <controller type='usb' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <interface type='bridge'>
      <mac address='***************'/>
      <source bridge='br0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='tablet' bus='usb'/>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='spice' autoport='yes'>
      <image compression='off'/>
    </graphics>
    <sound model='ich6'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </sound>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <hostdev mode='subsystem' type='usb' managed='yes'>
      <source>
        <vendor id='0x0658'/>
        <product id='0x0200'/>
      </source>
    </hostdev>
    <redirdev bus='usb' type='spicevmc'>
    </redirdev>
    <redirdev bus='usb' type='spicevmc'>
    </redirdev>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </memballoon>
  </devices>
</domain>

Thanks.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu libvirt Edit question
Assignee:
No assignee Edit question
Solved by:
Thierry Bouhnik
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

What is the file system mounted at /media/ds415play please?

Revision history for this message
Thierry Bouhnik (thierryb180381) said :
#2

Hello,

It's a samba resource to point to my NAS, mounted with "cifs":

//ds415play.local/donnees/ /media/ds415play/donnees cifs rw,relatime,vers=1.0,cache=strict,username=thierry,domain=DS415PLAY,uid=0,noforceuid,gid=0,noforcegid,addr=*****,unix,posixpaths,serverino,mapposix,acl,rsize=1048576,wsize=1048576,actimeo=1 0 0

I already test and this location is writable from my intel nuc.

Thanks.

Revision history for this message
Thierry Bouhnik (thierryb180381) said :
#3

# virsh snapshot-create-as --domain jeedom —-name jeedom_snap --diskspec vda,snapshot=external,file=/home/thierry/VM/backups/jeedom_vda_snap.qcow2 --memspec file=/home/thierry/VM/backups/jeedom_mem_snap.qcow2,snapshot=external --atomic
Domain snapshot —-name created

You were right, it works now.

So it's incompatible with cifs mount ? :(

Thanks.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#4

Possible. That's why I ask. You could try moving it to cifs then move it back then try using the file.
File systems are weird sometimes. You get a lot of folks trying NTFS and it doesn't hold Linux permissions. Not sure why you can't use CIFS

Revision history for this message
Thierry Bouhnik (thierryb180381) said :
#5

Ok, thanks.

Another question if it's possible in this thread, even if it's not the same as origin :

I try to active the original image with:
virsh blockcommit jeedom vda --active --verbose --pivot

But with that command, I see alway that
# virsh snapshot-list jeedom
 Nom Creation Time État
------------------------------------------------------------
 —-name 2017-08-07 21:19:55 +0200 running

it means that it's always running?
It seems that this VM was called "—-name".

With
 virsh domblklist jeedom
Target Source
------------------------------------------------
vda /var/lib/libvirt/images/debian_jessy.qcow2

It seems that the main image was coming back so I could try to delete that snap test.

I tried to delete it without success with
 virsh snapshot-delete --domain jeedom --snapshotname —-name
erreur : Failed to delete snapshot —-name
erreur : unsupported configuration: deletion of 1 external disk snapshots not supported yet

How could I do to delete it without risk as " virsh domblklist jeedom" show my main VM?

Remove manually xml file and files in VM/backups/ ?

Could I open a bug for this problem of deletion?

Thanks :)

Revision history for this message
Thierry Bouhnik (thierryb180381) said :
#6

Problem also resolved:
 virsh snapshot-delete --domain jeedom --metadata —-name
Domain snapshot —-name deleted

Many thanks for all.