summaryrefslogtreecommitdiff
path: root/nova/virt/libvirt/volume/lightos.py
diff options
context:
space:
mode:
authoryuval brave <yuval@lightbitslabs.com>2021-12-13 18:13:19 +0200
committerElod Illes <elod.illes@est.tech>2022-02-22 16:17:29 +0100
commitb5e2128f3847d444a808a2b0f89e6f1e4ffb77fc (patch)
treec1d17b5d7425a941c91e42096f9c776e3e9abe8a /nova/virt/libvirt/volume/lightos.py
parent0c31561792e0e13a9f8267e71fa484ab79957f04 (diff)
downloadnova-b5e2128f3847d444a808a2b0f89e6f1e4ffb77fc.tar.gz
Lightbits LightOS driver
This commit introduces the LightOS driver for nova. LightOS is a software-defined disaggregated clustered storage solution running on commodity servers with commodity SSDs. It it developed by Lightbits Labs (https://www.lightbitslabs.com) and is actively developed and maintained. LightOS is proprietary but the openstack drivers are licensed under Apache v2.0. The Cinder driver for LightOS currently supports the following functionality: Create volume Delete volume Attach volume Detach volume Create image from volume create volume from image Live migration Volume replication Thin provisioning Multi-attach Extend volume Create snapshot Delete snapshot Create volume from snapshot Create volume from volume (clone) This driver has been developed and has been in use for a couple of years by Lightbits and our clients. We have tested it extensively internally with multiple openstack versions, including Queens, Rocky, Stein, and Train. We have also tested it with master (19.1 xena) and we are working to extend testing to cover additional openstack releases. We are glad to join the openstack community and hope to get your feedback and comments on this driver, and if it is acceptable, to see it merged into the tree. Note: the patch depends on os-brick 5.2.0. That version also increased the lower constraints of several dependencies, thus needs nova to increase those as well in requirements.txt, lower-constraints.txt and setup.cfg. Depends-On: I2e86fa84049053b7c75421d33ad1a1af459ef4e0 Signed-off-by: Yuval Brave yuval@lightbitslabs.com Change-Id: Ic314b26695d9681d31a18adcec0794c2ff41fe71
Diffstat (limited to 'nova/virt/libvirt/volume/lightos.py')
-rw-r--r--nova/virt/libvirt/volume/lightos.py63
1 files changed, 63 insertions, 0 deletions
diff --git a/nova/virt/libvirt/volume/lightos.py b/nova/virt/libvirt/volume/lightos.py
new file mode 100644
index 0000000000..d6d393994e
--- /dev/null
+++ b/nova/virt/libvirt/volume/lightos.py
@@ -0,0 +1,63 @@
+# Copyright (C) 2016-2020 Lightbits Labs Ltd.
+# Copyright (C) 2020 Intel Corporation
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+import nova.conf
+from nova import utils
+from nova.virt.libvirt.volume import volume as libvirt_volume
+from os_brick import initiator
+from os_brick.initiator import connector
+from oslo_log import log as logging
+
+
+LOG = logging.getLogger(__name__)
+CONF = nova.conf.CONF
+
+
+class LibvirtLightOSVolumeDriver(libvirt_volume.LibvirtVolumeDriver):
+ """Driver to attach NVMe volumes to libvirt."""
+ VERSION = '2.3.12'
+
+ def __init__(self, connection):
+ super(LibvirtLightOSVolumeDriver, self).__init__(connection)
+ self.connector = connector.InitiatorConnector.factory(
+ initiator.LIGHTOS,
+ root_helper=utils.get_root_helper(),
+ device_scan_attempts=CONF.libvirt.num_nvme_discover_tries)
+
+ def connect_volume(self, connection_info, instance):
+ device_info = self.connector.connect_volume(connection_info['data'])
+ LOG.debug("Connecting NVMe volume with device_info %s", device_info)
+ connection_info['data']['device_path'] = device_info['path']
+
+ def disconnect_volume(self, connection_info, instance):
+ """Detach the volume from the instance."""
+ LOG.debug("Disconnecting NVMe disk. instance:%s, volume_id:%s",
+ connection_info.get("instance", ""),
+ connection_info.get("volume_id", ""))
+ self.connector.disconnect_volume(connection_info['data'], None)
+ super(LibvirtLightOSVolumeDriver, self).disconnect_volume(
+ connection_info, instance)
+
+ def extend_volume(self, connection_info, instance, requested_size=None):
+ """Extend the volume."""
+ LOG.debug("calling os-brick to extend LightOS Volume."
+ "instance:%s, volume_id:%s",
+ connection_info.get("instance", ""),
+ connection_info.get("volume_id", ""))
+ new_size = self.connector.extend_volume(connection_info['data'])
+ LOG.debug("Extend LightOS Volume %s; new_size=%s",
+ connection_info['data']['device_path'], new_size)
+ return new_size