Bug 1029383

Summary: Can't create snapshots of a shutdown guest with nbd network disk
Product: [Community] Virtualization Tools Reporter: Shanzhi Yu <shyu>
Component: libvirtAssignee: Eric Blake <eblake>
Status: CLOSED DEFERRED QA Contact: lijuan men <lmen>
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: dyuan, eblake, hhan, libvirt-maint, mzhan, shyu, xuzhang
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-03 16:39:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Shanzhi Yu 2013-11-12 10:23:30 UTC
Description of problem:

a shutdown guest with nbd network disk can't do snapshot

Version-Release number of selected component:
qemu-kvm-rhev-1.5.3-19.el7.x86_64
libvirt-1.1.1-12.el7.x86_64

How reproducible:
100%

Steps:
1. start a guest with nbd network disk
    <disk type='network' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source protocol='nbd'>
        <host name='10.66.5.93' port='10809'/>
      </source>
      <target dev='sda' bus='scsi'/>
    </disk>
   <controller type='scsi' index='0' model='virtio-scsi'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </controller>

# virsh define rhel6.xml
Domain rhel6 defined from rhel6.xml
# virsh start rhel6
Domain rhel6 started

2. do snapshot when guest is running
# virsh snapshot-create-as rhel6 s1
Domain snapshot s1 created


3. do snapshot when guest is shutdown
# virsh snapshot-create-as rhel6 s2
error: internal error: Child process (/usr/bin/qemu-img snapshot -c 1384237951) unexpected exit status 1


Actual results:

as above

Expected results:

can do snapshot for an shutdown guest

Comment 6 Eric Blake 2015-07-28 15:32:22 UTC
It might be possible for libvirt to do network disk snapshots of offline domains by using 'qemu --machine none' and managing that process for the lengthy operation; but that is an upstream feature that would still need to be written.

Comment 9 Ademar Reis 2016-12-21 20:38:00 UTC
(In reply to Shanzhi Yu from comment #0)
> Description of problem:
> 
> a shutdown guest with nbd network disk can't do snapshot
> 
> Version-Release number of selected component:
> qemu-kvm-rhev-1.5.3-19.el7.x86_64
> libvirt-1.1.1-12.el7.x86_64
> 
> How reproducible:
> 100%
> 
> Steps:
> 1. start a guest with nbd network disk
>     <disk type='network' device='disk'>
>       <driver name='qemu' type='qcow2'/>
>       <source protocol='nbd'>
>         <host name='10.66.5.93' port='10809'/>
>       </source>
>       <target dev='sda' bus='scsi'/>
>     </disk>
>    <controller type='scsi' index='0' model='virtio-scsi'>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x08'
> function='0x0'/>
>     </controller>
> 
> # virsh define rhel6.xml
> Domain rhel6 defined from rhel6.xml
> # virsh start rhel6
> Domain rhel6 started
> 
> 2. do snapshot when guest is running
> # virsh snapshot-create-as rhel6 s1
> Domain snapshot s1 created
> 
> 
> 3. do snapshot when guest is shutdown
> # virsh snapshot-create-as rhel6 s2
> error: internal error: Child process (/usr/bin/qemu-img snapshot -c
> 1384237951) unexpected exit status 1
> 

Can you please try creating an external snapshot with the same configuration? Thanks.

Comment 11 Han Han 2017-06-14 07:16:46 UTC
Hi Ademar, on libvirt-3.2.0-9.el7.x86_64 qemu-kvm-rhev-2.9.0-10.el7.x86_64, it's OK to create external snapshot

1. Start vm with following xml:
    <disk type='network' device='disk'>
      <driver name='qemu' type='raw'/>
      <source protocol='nbd'>
        <host name='XX.XX.XX.XX' port='10801'/>
      </source>
      <target dev='sda' bus='scsi'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

2. Create externel snapshot :
# virsh snapshot-create-as q35 --disk-only --diskspec sda,file=/tmp/bnd
Domain snapshot 1497424384 created

3. Dump vm's xml:
# virsh dumpxml q35|awk '/<disk/,/<\/disk/'                                                                    
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/tmp/bnd'/>
      <backingStore type='network' index='1'>
        <format type='raw'/>
        <source protocol='nbd'>
          <host name='10.66.5.92' port='10801'/>
        </source>
        <backingStore/>
      </backingStore>
      <target dev='sda' bus='scsi'/>
      <alias name='scsi0-0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

Comment 12 Daniel Berrangé 2020-11-03 16:39:07 UTC
Thank you for reporting this issue to the libvirt project. Unfortunately we have been unable to resolve this issue due to insufficient maintainer capacity and it will now be closed. This is not a reflection on the possible validity of the issue, merely the lack of resources to investigate and address it, for which we apologise. If you none the less feel the issue is still important, you may choose to report it again at the new project issue tracker https://gitlab.com/libvirt/libvirt/-/issues The project also welcomes contribution from anyone who believes they can provide a solution.