Skip to content

Commit

Permalink
libvirt: remove glusterfs volume driver
Browse files Browse the repository at this point in the history
Cinder deprecated the GlusterFS volume driver
in Newton and deleted it in Ocata:

I10c576602dd0e65947d1a1af5d04b8ada54f4625

Since it's unused, unmaintained and unsupported in
Cinder we should remove it from the libvirt driver.

This also removes the related configuration options.

A note is left in the code since I'm unsure if anything
relies on checking for the netfs disk source_protocol which
was added at the same time as the glusterfs support in
Ic6dd861b40b692b25df67c9d5b63fd436c690fde.

Change-Id: I2745f5578646ec994b53f6b5c0a5f62637b0948a
  • Loading branch information
mriedem committed May 19, 2017
1 parent 9e5b915 commit 5c5bc57
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 337 deletions.
6 changes: 3 additions & 3 deletions api-ref/source/os-assisted-volume-snapshots.inc
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ file format is supported.

This API is only implemented by the libvirt compute driver.

An internal snapshot that lacks storage such as NFS or GlusterFS can use
An internal snapshot that lacks storage such as NFS can use
an emulator/hypervisor to add the snapshot feature.
This is used to enable snapshot of volumes on backends such as NFS or
GlusterFS by storing data as qcow2 files on these volumes.
This is used to enable snapshot of volumes on backends such as NFS
by storing data as qcow2 files on these volumes.

This API is only ever called by Cinder, where it is used to create a snapshot
for drivers that extend the remotefs Cinder driver.
Expand Down
2 changes: 1 addition & 1 deletion doc/source/support-matrix.ini
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ notes=Block storage provides instances with direct attached
As an alternative to direct attached disks, an instance may
choose to use network based persistent storage. OpenStack provides
object storage via the Swift service, or a traditional filesystem
such as NFS/GlusterFS may be used. Some types of instances may
such as NFS may be used. Some types of instances may
not require persistent storage at all, being simple transaction
processing systems reading requests & sending results to and from
the network. Therefore support for this configuration is not
Expand Down
23 changes: 0 additions & 23 deletions nova/conf/libvirt.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,19 +759,6 @@
]

libvirt_volume_opts = [
cfg.ListOpt('qemu_allowed_storage_drivers',
default=[],
help="""
Protocols listed here will be accessed directly from QEMU.
If gluster is present in qemu_allowed_storage_drivers, glusterfs's backend will
pass a disk configuration to QEMU. This allows QEMU to access the volume using
libgfapi rather than mounting GlusterFS via fuse.
Possible values:
* [gluster]
"""),
cfg.BoolOpt('volume_use_multipath',
default=False,
deprecated_name='iscsi_use_multipath',
Expand Down Expand Up @@ -801,15 +788,6 @@
""")
]

libvirt_volume_glusterfs_opts = [
cfg.StrOpt('glusterfs_mount_point_base',
default=paths.state_path_def('mnt'),
help="""
Absolute path to the directory where the glusterfs volume is mounted on the
compute node.
""")
]

libvirt_volume_iscsi_opts = [
cfg.StrOpt('iscsi_iface',
deprecated_name='iscsi_transport',
Expand Down Expand Up @@ -1061,7 +1039,6 @@
libvirt_vif_opts,
libvirt_volume_opts,
libvirt_volume_aoe_opts,
libvirt_volume_glusterfs_opts,
libvirt_volume_iscsi_opts,
libvirt_volume_iser_opts,
libvirt_volume_net_opts,
Expand Down
10 changes: 5 additions & 5 deletions nova/tests/unit/virt/libvirt/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1127,12 +1127,12 @@ def test_config_file_parse(self):
def test_config_network_parse(self):
xml = """<backingStore type='network' index='1'>
<format type='qcow2'/>
<source protocol='gluster' name='volume1/img1'>
<source protocol='netfs' name='volume1/img1'>
<host name='host1' port='24007'/>
</source>
<backingStore type='network' index='2'>
<format type='qcow2'/>
<source protocol='gluster' name='volume1/img2'>
<source protocol='netfs' name='volume1/img2'>
<host name='host1' port='24007'/>
</source>
<backingStore/>
Expand All @@ -1145,7 +1145,7 @@ def test_config_network_parse(self):
obj.parse_dom(xmldoc)

self.assertEqual(obj.source_type, 'network')
self.assertEqual(obj.source_protocol, 'gluster')
self.assertEqual(obj.source_protocol, 'netfs')
self.assertEqual(obj.source_name, 'volume1/img1')
self.assertEqual(obj.source_hosts[0], 'host1')
self.assertEqual(obj.source_ports[0], '24007')
Expand Down Expand Up @@ -2474,7 +2474,7 @@ def test_config_snapshot_with_network_disks(self):
disk.source_type = 'network'
disk.source_hosts = ['host1']
disk.source_ports = ['12345']
disk.source_protocol = 'glusterfs'
disk.source_protocol = 'netfs'
disk.snapshot = 'external'
disk.driver_name = 'qcow2'
obj.add_disk(disk)
Expand All @@ -2490,7 +2490,7 @@ def test_config_snapshot_with_network_disks(self):
<name>Demo</name>
<disks>
<disk name='vda' snapshot='external' type='network'>
<source protocol='glusterfs' name='source-file'>
<source protocol='netfs' name='source-file'>
<host name='host1' port='12345'/>
</source>
</disk>
Expand Down
14 changes: 6 additions & 8 deletions nova/tests/unit/virt/libvirt/test_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -17797,7 +17797,6 @@ def setUp(self):
self.c = context.get_admin_context()

self.flags(instance_name_template='instance-%s')
self.flags(qemu_allowed_storage_drivers=[], group='libvirt')

# creating instance
self.inst = {}
Expand Down Expand Up @@ -17833,17 +17832,17 @@ def setUp(self):
</disk>
<disk type='network' device='disk'>
<driver name='qemu' type='qcow2'/>
<source protocol='gluster' name='vol1/root.img'>
<source protocol='netfs' name='vol1/root.img'>
<host name='server1' port='24007'/>
</source>
<backingStore type='network' index='1'>
<driver name='qemu' type='qcow2'/>
<source protocol='gluster' name='vol1/snap.img'>
<source protocol='netfs' name='vol1/snap.img'>
<host name='server1' port='24007'/>
</source>
<backingStore type='network' index='2'>
<driver name='qemu' type='qcow2'/>
<source protocol='gluster' name='vol1/snap-b.img'>
<source protocol='netfs' name='vol1/snap-b.img'>
<host name='server1' port='24007'/>
</source>
<backingStore/>
Expand All @@ -17867,12 +17866,12 @@ def setUp(self):
</disk>
<disk type='network' device='disk'>
<driver name='qemu' type='qcow2'/>
<source protocol='gluster' name='vol1/snap.img'>
<source protocol='netfs' name='vol1/snap.img'>
<host name='server1' port='24007'/>
</source>
<backingStore type='network' index='1'>
<driver name='qemu' type='qcow2'/>
<source protocol='gluster' name='vol1/root.img'>
<source protocol='netfs' name='vol1/root.img'>
<host name='server1' port='24007'/>
</source>
<backingStore/>
Expand Down Expand Up @@ -18028,7 +18027,6 @@ def _test_volume_snapshot_create(self, quiesce=True, can_quiesce=True,
def test_volume_snapshot_create_libgfapi(self):
"""Test snapshot creation with libgfapi network disk."""
self.flags(instance_name_template = 'instance-%s')
self.flags(qemu_allowed_storage_drivers = ['gluster'], group='libvirt')
self.mox.StubOutWithMock(self.drvr._host, 'get_domain')
self.mox.StubOutWithMock(self.drvr, '_volume_api')

Expand All @@ -18041,7 +18039,7 @@ def test_volume_snapshot_create_libgfapi(self):
<serial>0e38683e-f0af-418f-a3f1-6b67ea0f919d</serial>
</disk>
<disk type='block'>
<source protocol='gluster' name='gluster1/volume-1234'>
<source protocol='netfs' name='netfs1/volume-1234'>
<host name='127.3.4.5' port='24007'/>
</source>
<target dev='vdb' bus='virtio' serial='1234'/>
Expand Down
178 changes: 0 additions & 178 deletions nova/tests/unit/virt/libvirt/volume/test_glusterfs.py

This file was deleted.

20 changes: 11 additions & 9 deletions nova/virt/libvirt/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,6 @@
'nfs=nova.virt.libvirt.volume.nfs.LibvirtNFSVolumeDriver',
'smbfs=nova.virt.libvirt.volume.smbfs.LibvirtSMBFSVolumeDriver',
'aoe=nova.virt.libvirt.volume.aoe.LibvirtAOEVolumeDriver',
'glusterfs='
'nova.virt.libvirt.volume.glusterfs.LibvirtGlusterfsVolumeDriver',
'fibre_channel='
'nova.virt.libvirt.volume.fibrechannel.'
'LibvirtFibreChannelVolumeDriver',
Expand Down Expand Up @@ -400,11 +398,10 @@ def disk_cachemode(self):
if self._disk_cachemode is None:
# We prefer 'none' for consistent performance, host crash
# safety & migration correctness by avoiding host page cache.
# Some filesystems (eg GlusterFS via FUSE) don't support
# O_DIRECT though. For those we fallback to 'writethrough'
# which gives host crash safety, and is safe for migration
# provided the filesystem is cache coherent (cluster filesystems
# typically are, but things like NFS are not).
# Some filesystems don't support O_DIRECT though. For those we
# fallback to 'writethrough' which gives host crash safety, and
# is safe for migration provided the filesystem is cache coherent
# (cluster filesystems typically are, but things like NFS are not).
self._disk_cachemode = "none"
if not self._supports_direct_io(CONF.instances_path):
self._disk_cachemode = "writethrough"
Expand Down Expand Up @@ -1893,7 +1890,7 @@ def _volume_snapshot_create(self, context, instance, guest,
device_info.parse_dom(xml_doc)

disks_to_snap = [] # to be snapshotted by libvirt
network_disks_to_snap = [] # network disks (netfs, gluster, etc.)
network_disks_to_snap = [] # network disks (netfs, etc.)
disks_to_skip = [] # local disks not snapshotted

for guest_disk in device_info.devices:
Expand Down Expand Up @@ -1925,7 +1922,12 @@ def _volume_snapshot_create(self, context, instance, guest,
new_file_path = os.path.join(os.path.dirname(current_file),
new_file)
disks_to_snap.append((current_file, new_file_path))
elif disk_info['source_protocol'] in ('gluster', 'netfs'):
# NOTE(mriedem): This used to include a check for gluster in
# addition to netfs since they were added together. Support for
# gluster was removed in the 16.0.0 Pike release. It is unclear,
# however, if other volume drivers rely on the netfs disk source
# protocol.
elif disk_info['source_protocol'] == 'netfs':
network_disks_to_snap.append((disk_info, new_file))

if not disks_to_snap and not network_disks_to_snap:
Expand Down
Loading

0 comments on commit 5c5bc57

Please sign in to comment.