Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1465810 - [libgfapi] Unable to make snapshot of the VM with disk on replica 3 gluster volume
Summary: [libgfapi] Unable to make snapshot of the VM with disk on replica 3 gluster v...
Keywords:
Status: ASSIGNED
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: libvirt
Version: 8.0
Hardware: Unspecified
OS: Unspecified
urgent
high
Target Milestone: rc
: 8.1
Assignee: Peter Krempa
QA Contact: Han Han
URL:
Whiteboard:
Depends On: 760547
Blocks: 1484227 1633642 1636224
TreeView+ depends on / blocked
 
Reported: 2017-06-28 09:14 UTC by Denis Chaplygin
Modified: 2019-04-09 12:37 UTC (History)
22 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)

Description Denis Chaplygin 2017-06-28 09:14:36 UTC
Description of problem: I have a VM backed by file on replica 3 gluster volume with libgfapi enabled. When i try to make a snpshot of that VM, libvirt answers me:


internal error: protocol 'gluster' accepts only one host


Version-Release number of selected component (if applicable):
 libvirt-daemon.x86_64                  2.0.0-10.el7_3.9


How reproducible: Always


Steps to Reproduce:
1. Create a replica 3 gluster volume and place image file for vm on it.
2. Run a VM accessing that file using libgfapi and all three hosts
3. Try to make a snapshot

Actual results: error is returned: "internal error: protocol 'gluster' accepts only one host"


Expected results: Snapshot should be created.


Additional info: Here is a XML definition of my VM disks:

      <disk type='network' device='disk' snapshot='no'>
        <driver name='qemu' type='raw' cache='none' error_policy='stop' io='threads'/>
        <source protocol='gluster' name='data/image'>
          <host name='host1' port='0'/>
          <host name='host2' port='0'/>
          <host name='host3' port='0'/>
        </source>
        <backingStore/>
        <target dev='sda' bus='scsi'/>
        <serial>8a96ac00-96fc-452d-ae42-eb2a8bd27c43</serial>
        <boot order='1'/>
        <alias name='scsi0-0-0-0'/>
        <address type='drive' controller='0' bus='0' target='0' unit='0'/>
      </disk>

Comment 2 lijuan men 2017-06-30 09:12:21 UTC
I can't reproduce the issue

version:
libvirt-2.0.0-10.el7_3.9.x86_64
qemu-kvm-rhev-2.6.0-28.el7_3.12.x86_64
glusterfs-server-3.8.4-31.el7rhgs.1.1463907.x86_64

steps:
1.prepare the glusterfs env

[root@localhost ~]# gluster volume create test replica 3 10.66.70.107:/opt/b1 10.66.4.163:/opt/b2 10.66.7.102:/opt/b3 force

[root@localhost ~]# gluster volume start test

[root@localhost ~]# gluster volume info
Volume Name: test
Type: Replicate
Volume ID: 5502765d-4c5a-41a7-958d-4a6b7f937359
Status: Started
Snapshot Count: 0
Number of Bricks: 1 x 3 = 3
Transport-type: tcp
Bricks:
Brick1: 10.66.70.107:/opt/b1
Brick2: 10.66.4.163:/opt/b2
Brick3: 10.66.7.102:/opt/b3
Options Reconfigured:
server.allow-insecure: on
transport.address-family: inet
nfs.disable: on

2.start a guest with a gluster disk with the xml:
 <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/RHEL-7.4-x86_64-latest.qcow2'/>
      <target dev='hda' bus='ide'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='network' device='disk' snapshot='no'>
      <driver name='qemu' type='raw' cache='none' error_policy='stop' io='threads'/>
      <source protocol='gluster' name='test/test.img'>
        <host name='10.66.70.107'/>
        <host name='10.66.4.163'/>
        <host name='10.66.7.102'/>
      </source>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
    </disk>

[root@localhost ~]# virsh domblklist test
Target     Source
------------------------------------------------
hda        /var/lib/libvirt/images/RHEL-7.4-x86_64-latest.qcow2
vda        test/test.qcow2

3.create all kinds of snapshots

[root@localhost ~]# virsh snapshot-create-as test s1
error: unsupported configuration: internal snapshots and checkpoints require all disks to be selected for snapshot

[root@localhost ~]# virsh snapshot-create-as test s1 --memspec file=/tmp/s1.mem
Domain snapshot s1 created

[root@localhost ~]# virsh snapshot-create-as test s2 --disk-only --diskspec vda,file=/tmp/s2
Domain snapshot s2 created


I can not see the error info in bug description

So I want to know:
1)Are the steps above same with the bug description?
2)what are the versions of qemu-kvm-rhev and glusterfs-server you used?
3)what is the detailed creating snapshot command you used?

Comment 3 Peter Krempa 2017-06-30 09:28:59 UTC
(In reply to lijuan men from comment #2)
> Domain snapshot s1 created
> 
> [root@localhost ~]# virsh snapshot-create-as test s2 --disk-only --diskspec
> vda,file=/tmp/s2
> Domain snapshot s2 created

The overlay image needs to be a 3 brick replica on gluster too. You need to specify it via XML to snapshot-create.

You created a snapshot to a local file, which obviously works.

Comment 4 lijuan men 2017-07-03 02:41:31 UTC
(In reply to Peter Krempa from comment #3)
> (In reply to lijuan men from comment #2)
> > Domain snapshot s1 created
> > 
> > [root@localhost ~]# virsh snapshot-create-as test s2 --disk-only --diskspec
> > vda,file=/tmp/s2
> > Domain snapshot s2 created
> 
> The overlay image needs to be a 3 brick replica on gluster too. You need to
> specify it via XML to snapshot-create.
> 
> You created a snapshot to a local file, which obviously works.

thanks,peter, based on your comment,I can reproduce it

steps:

1.start a guest with 2 disks,hda is a local disk,vda is a gluster disk

[root@localhost ~]# virsh domblklist test
Target     Source
------------------------------------------------
hda        /var/lib/libvirt/images/RHEL-7.4-x86_64-latest.qcow2
vda        test/test.img

2.for vda, create an external snapshot with replica 3 gluster disk

[root@localhost ~]# cat snapshot.xml 
<domainsnapshot>
<name>my snap name</name>
<disks>
<disk name='vda' snapshot='external' type='network'>
 <source protocol='gluster' name='test/sna.qcow2'>
<host name='10.66.70.107'/>
<host name='10.66.4.163'/>
<host name='10.66.7.102'/>
</source>
</disk>
</disks>
 </domainsnapshot>

[root@localhost ~]# virsh snapshot-create test snapshot.xml --disk-only
error: internal error: protocol 'gluster' accepts only one host

3.for hda, create an external snapshot with replica 3 gluster disk

[root@localhost ~]# cat snapshot.xml 
<domainsnapshot>
<name>my snap name</name>
<disks>
<disk name='hda' snapshot='external' type='network'>
 <source protocol='gluster' name='test/sna.qcow2'>
<host name='10.66.70.107'/>
<host name='10.66.4.163'/>
<host name='10.66.7.102'/>
</source>
</disk>
</disks>
 </domainsnapshot>

[root@localhost ~]# virsh snapshot-create test snapshot.xml --disk-only
error: internal error: protocol 'gluster' accepts only one host

Comment 11 Peter Krempa 2017-07-13 11:26:32 UTC
Unfortunately qemu does not accept any of the modern JSON based ways to specify the target for the snapshot directly. The only way is to use blockdev-add along with this which will require more work.

Comment 32 Jaroslav Suchanek 2019-04-09 12:37:49 UTC
This is going to be finalized in the next major RHEL release.


Note You need to log in before you can comment on or make changes to this bug.