Merge "libvirt: Drop support for UML"

This commit is contained in:
Zuul 2021-01-27 02:14:36 +00:00 committed by Gerrit Code Review
commit b4cf40a07f
15 changed files with 31 additions and 118 deletions

View File

@ -63,8 +63,6 @@ availability zones. Compute supports the following hypervisors:
- `Quick Emulator (QEMU) <https://wiki.qemu.org/Manual>`__
- `User Mode Linux (UML) <http://user-mode-linux.sourceforge.net>`__
- `Virtuozzo <https://www.virtuozzo.com/products/vz7.html>`__
- `VMware vSphere

View File

@ -811,7 +811,7 @@ Tag VMware images
In a mixed hypervisor environment, OpenStack Compute uses the
``hypervisor_type`` tag to match images to the correct hypervisor type. For
VMware images, set the hypervisor type to ``vmware``. Other valid hypervisor
types include: ``hyperv``, ``ironic``, ``lxc``, ``qemu``, ``uml``, and ``xen``.
types include: ``hyperv``, ``ironic``, ``lxc``, ``qemu``, and ``xen``.
Note that ``qemu`` is used for both QEMU and KVM hypervisor types.
.. code-block:: console

View File

@ -2,9 +2,6 @@
Hypervisors
===========
.. TODO: Add UML (User-Mode Linux) hypervisor to the following list when its
dedicated documentation is ready.
.. toctree::
:maxdepth: 1
@ -60,9 +57,6 @@ The following hypervisors are supported:
* `zVM`_ - Server virtualization on z Systems and IBM LinuxONE, it can run Linux,
z/OS and more.
* `UML`_ - User-Mode Linux is a safe, secure way of running Linux versions and Linux
processes.
* `Ironic`_ - OpenStack project which provisions bare metal (as opposed to virtual)
machines.
@ -101,5 +95,4 @@ virt drivers:
.. _Virtuozzo: https://www.virtuozzo.com/products/vz7.html
.. _PowerVM: https://www.ibm.com/us-en/marketplace/ibm-powervm
.. _zVM: https://www.ibm.com/it-infrastructure/z/zvm
.. _UML: http://user-mode-linux.sourceforge.net
.. _Ironic: https://docs.openstack.org/ironic/latest/

View File

@ -478,8 +478,7 @@ The image properties that the filter checks for are:
``hw_vm_mode``
describes the hypervisor application binary interface (ABI) required by the
image. Examples are ``xen`` for Xen 3.0 paravirtual ABI, ``hvm`` for native
ABI, ``uml`` for User Mode Linux paravirtual ABI, ``exe`` for container virt
executable ABI.
ABI, and ``exe`` for container virt executable ABI.
.. versionchanged:: 12.0.0 (Liberty)

View File

@ -1,10 +1,6 @@
Feature Support Matrix
======================
.. TODO: Add UML (User-Mode Linux) hypervisor and its support status
for the listed features to the support matrix.
When considering which capabilities should be marked as mandatory the
following general guiding principles were applied

View File

@ -104,7 +104,7 @@ Related options:
"""),
cfg.StrOpt('virt_type',
default='kvm',
choices=('kvm', 'lxc', 'qemu', 'uml', 'xen', 'parallels'),
choices=('kvm', 'lxc', 'qemu', 'xen', 'parallels'),
help="""
Describes the virtualization type (or so called domain type) libvirt should
use.

View File

@ -1443,7 +1443,6 @@ class Connection(object):
'qemu:///session',
'lxc:///', # from LibvirtDriver._uri()
'xen:///', # from LibvirtDriver._uri()
'uml:///system',
'test:///default',
'parallels:///system']

View File

@ -1004,10 +1004,9 @@ class LibvirtBlockInfoTest(test.NoDBTestCase):
('scsi', ("kvm", "sdf")),
('virtio', ("kvm", "vds")),
('fdc', ("kvm", "fdc")),
('uml', ("kvm", "ubd")),
('xen', ("xen", "sdf")),
('xen', ("xen", "xvdb"))
)
('xen', ("xen", "xvdb")),
)
for res, args in expected:
self.assertEqual(res, blockinfo.get_disk_bus_for_disk_dev(*args))
@ -1307,7 +1306,7 @@ class LibvirtBlockInfoTest(test.NoDBTestCase):
def test_get_rescue_bus(self):
# Assert that all supported device bus types are returned. Stable
# device rescue is not supported by xen or lxc so ignore these.
for virt_type in ['qemu', 'kvm', 'uml', 'parallels']:
for virt_type in ['qemu', 'kvm', 'parallels']:
for bus in blockinfo.SUPPORTED_DEVICE_BUSES[virt_type]:
meta = self._get_rescue_image_meta({'hw_rescue_bus': bus})
self.assertEqual(bus, blockinfo.get_rescue_bus(None, virt_type,

View File

@ -5171,36 +5171,6 @@ class LibvirtConnTestCase(test.NoDBTestCase,
self.assertIsInstance(cfg.devices[10],
vconfig.LibvirtConfigMemoryBalloon)
def test_get_guest_config_with_root_device_name(self):
self.flags(virt_type='uml', group='libvirt')
drvr = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)
instance_ref = objects.Instance(**self.test_instance)
image_meta = objects.ImageMeta.from_dict(self.test_image_meta)
block_device_info = {'root_device_name': '/dev/vdb'}
disk_info = blockinfo.get_disk_info(CONF.libvirt.virt_type,
instance_ref,
image_meta,
block_device_info)
cfg = drvr._get_guest_config(instance_ref, [],
image_meta, disk_info,
None, block_device_info)
self.assertEqual(0, len(cfg.features))
self.assertEqual(cfg.memory, instance_ref.flavor.memory_mb * units.Ki)
self.assertEqual(cfg.vcpus, instance_ref.flavor.vcpus)
self.assertEqual(cfg.os_type, "uml")
self.assertEqual(cfg.os_boot_dev, [])
self.assertEqual(cfg.os_root, '/dev/vdb')
self.assertEqual(len(cfg.devices), 4)
self.assertIsInstance(cfg.devices[0],
vconfig.LibvirtConfigGuestDisk)
self.assertIsInstance(cfg.devices[1],
vconfig.LibvirtConfigGuestDisk)
self.assertIsInstance(cfg.devices[2],
vconfig.LibvirtConfigGuestConsole)
self.assertIsInstance(cfg.devices[3],
vconfig.LibvirtConfigGuestUSBHostController)
def test_has_uefi_support_not_supported_arch(self):
drvr = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)
self._stub_host_capabilities_cpu_arch(fields.Architecture.ALPHA)
@ -8019,23 +7989,6 @@ class LibvirtConnTestCase(test.NoDBTestCase,
self.assertEqual(conf.cpu.cores, 1)
self.assertEqual(conf.cpu.threads, 1)
def test_get_guest_cpu_config_default_uml(self):
self.flags(virt_type="uml",
cpu_mode='none',
group='libvirt')
drvr = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)
instance_ref = objects.Instance(**self.test_instance)
image_meta = objects.ImageMeta.from_dict(self.test_image_meta)
disk_info = blockinfo.get_disk_info(CONF.libvirt.virt_type,
instance_ref,
image_meta)
conf = drvr._get_guest_config(instance_ref,
_fake_network_info(self),
image_meta, disk_info)
self.assertIsNone(conf.cpu)
def test_get_guest_cpu_config_default_lxc(self):
self.flags(virt_type="lxc",
cpu_mode='none',
@ -10442,10 +10395,6 @@ class LibvirtConnTestCase(test.NoDBTestCase,
(lambda t: t.find('.').get('type'), 'kvm'),
(lambda t: t.find('./devices/disk/target').get('dev'),
_get_prefix(prefix, 'vda'))],
'uml': [
(lambda t: t.find('.').get('type'), 'uml'),
(lambda t: t.find('./devices/disk/target').get('dev'),
_get_prefix(prefix, 'ubda'))]
}
for (virt_type, checks) in type_disk_map.items():
@ -10590,10 +10539,6 @@ class LibvirtConnTestCase(test.NoDBTestCase,
(lambda t: t.find('./os/type').text,
fields.VMMode.HVM),
(lambda t: t.find('./devices/emulator'), None)]),
'uml': ('uml:///system',
[(lambda t: t.find('.').get('type'), 'uml'),
(lambda t: t.find('./os/type').text,
fields.VMMode.UML)]),
'xen': ('xen:///',
[(lambda t: t.find('.').get('type'), 'xen'),
(lambda t: t.find('./os/type').text,
@ -25584,7 +25529,7 @@ class LibvirtDriverTestCase(test.NoDBTestCase, TraitsComparisonMixin):
all_traits = set(ot.get_traits('COMPUTE_STORAGE_BUS_'))
# ensure each virt type reports the correct bus types
for virt_type, buses in blockinfo.SUPPORTED_DEVICE_BUSES.items():
if virt_type in ('qemu', 'kvm'):
if virt_type in ('qemu', 'kvm', 'uml'):
continue
self.flags(virt_type=virt_type, group='libvirt')

View File

@ -161,7 +161,6 @@ class LibvirtUtilsTestCase(test.NoDBTestCase):
def test_pick_disk_driver_name(self):
type_map = {'kvm': ([True, 'qemu'], [False, 'qemu'], [None, 'qemu']),
'qemu': ([True, 'qemu'], [False, 'qemu'], [None, 'qemu']),
'uml': ([True, None], [False, None], [None, None]),
'lxc': ([True, None], [False, None], [None, None])}
# NOTE(aloga): Xen is tested in test_pick_disk_driver_name_xen

View File

@ -94,9 +94,12 @@ SUPPORTED_DEVICE_BUSES = {
'qemu': ['virtio', 'scsi', 'ide', 'usb', 'fdc', 'sata'],
'kvm': ['virtio', 'scsi', 'ide', 'usb', 'fdc', 'sata'],
'xen': ['xen', 'ide'],
# we no longer support UML, but we keep track of its bus types so we can
# reject them for other virt types
'uml': ['uml'],
'lxc': ['lxc'],
'parallels': ['ide', 'scsi']}
'parallels': ['ide', 'scsi'],
}
SUPPORTED_DEVICE_TYPES = ('disk', 'cdrom', 'floppy', 'lun')
@ -143,8 +146,6 @@ def get_dev_prefix_for_disk_bus(disk_bus):
return "sd"
elif disk_bus == "fdc":
return "fd"
elif disk_bus == "uml":
return "ubd"
elif disk_bus == "lxc":
return None
elif disk_bus == "sata":
@ -243,10 +244,7 @@ def get_disk_bus_for_device_type(instance,
return disk_bus
# Otherwise pick a hypervisor default disk bus
if virt_type == "uml":
if device_type == "disk":
return "uml"
elif virt_type == "lxc":
if virt_type == "lxc":
return "lxc"
elif virt_type == "xen":
guest_vm_mode = obj_fields.VMMode.get_from_instance(instance)
@ -319,8 +317,6 @@ def get_disk_bus_for_disk_dev(virt_type, disk_dev):
return "fdc"
elif disk_dev.startswith('xvd'):
return "xen"
elif disk_dev.startswith('ubd'):
return "uml"
else:
msg = _("Unable to determine disk bus for '%s'") % disk_dev[:1]
raise exception.InternalError(msg)

View File

@ -21,7 +21,7 @@
"""
A connection to a hypervisor through libvirt.
Supports KVM, LXC, QEMU, UML, XEN and Parallels.
Supports KVM, LXC, QEMU, XEN and Parallels.
"""
@ -1025,9 +1025,7 @@ class LibvirtDriver(driver.ComputeDriver):
@staticmethod
def _uri():
if CONF.libvirt.virt_type == 'uml':
uri = CONF.libvirt.connection_uri or 'uml:///system'
elif CONF.libvirt.virt_type == 'xen':
if CONF.libvirt.virt_type == 'xen':
uri = CONF.libvirt.connection_uri or 'xen:///'
elif CONF.libvirt.virt_type == 'lxc':
uri = CONF.libvirt.connection_uri or 'lxc:///'
@ -3783,7 +3781,7 @@ class LibvirtDriver(driver.ComputeDriver):
# NOTE(markus_z): The virt_types kvm and qemu are the only ones
# which create a dedicated file device for the console logging.
# Other virt_types like xen, lxc, uml, parallels depend on the
# Other virt_types like xen, lxc, and parallels depend on the
# flush of that pty device into the "console.log" file to ensure
# that a series of "get_console_output" calls return the complete
# content even after rebooting a guest.
@ -4064,15 +4062,9 @@ class LibvirtDriver(driver.ComputeDriver):
filename=fname,
image_id=disk_images['ramdisk_id'])
if CONF.libvirt.virt_type == 'uml':
# PONDERING(mikal): can I assume that root is UID zero in every
# OS? Probably not.
uid = pwd.getpwnam('root').pw_uid
nova.privsep.path.chown(image('disk').path, uid=uid)
created_disks = self._create_and_inject_local_root(
context, instance, booted_from_volume, suffix, disk_images,
injection_info, fallback_from_host)
context, instance, booted_from_volume, suffix, disk_images,
injection_info, fallback_from_host)
# Lookup the filesystem type if required
os_type_with_default = nova.privsep.fs.get_fs_type_for_os_type(
@ -5299,8 +5291,6 @@ class LibvirtDriver(driver.ComputeDriver):
"""Returns the guest OS type based on virt type."""
if virt_type == "lxc":
ret = fields.VMMode.EXE
elif virt_type == "uml":
ret = fields.VMMode.UML
elif virt_type == "xen":
ret = fields.VMMode.XEN
else:
@ -5399,7 +5389,7 @@ class LibvirtDriver(driver.ComputeDriver):
fields.Architecture.X86_64):
guest.features.append(vconfig.LibvirtConfigGuestFeaturePAE())
if (virt_type not in ("lxc", "uml", "parallels", "xen") or
if (virt_type not in ("lxc", "parallels", "xen") or
(virt_type == "xen" and guest.os_type == fields.VMMode.HVM)):
guest.features.append(vconfig.LibvirtConfigGuestFeatureACPI())
guest.features.append(vconfig.LibvirtConfigGuestFeatureAPIC())
@ -5768,20 +5758,16 @@ class LibvirtDriver(driver.ComputeDriver):
flavor.extra_specs.get('hw:boot_menu', 'no'))
else:
guest.os_bootmenu = image_meta.properties.hw_boot_menu
elif virt_type == "lxc":
guest.os_init_path = "/sbin/init"
guest.os_cmdline = CONSOLE
guest.os_init_env["product_name"] = "OpenStack Nova"
elif virt_type == "uml":
guest.os_kernel = "/usr/bin/linux"
guest.os_root = root_device_name
elif virt_type == "parallels":
if guest.os_type == fields.VMMode.EXE:
guest.os_init_path = "/sbin/init"
def _conf_non_lxc_uml(self, virt_type, guest, root_device_name, rescue,
instance, inst_path, image_meta, disk_info):
def _conf_non_lxc(self, virt_type, guest, root_device_name, rescue,
instance, inst_path, image_meta, disk_info):
if rescue:
self._set_guest_for_rescue(rescue, guest, inst_path, virt_type,
root_device_name)
@ -6126,8 +6112,8 @@ class LibvirtDriver(driver.ComputeDriver):
self._configure_guest_by_virt_type(guest, virt_type, caps, instance,
image_meta, flavor,
root_device_name, sev_enabled)
if virt_type not in ('lxc', 'uml'):
self._conf_non_lxc_uml(virt_type, guest, root_device_name, rescue,
if virt_type != 'lxc':
self._conf_non_lxc(virt_type, guest, root_device_name, rescue,
instance, inst_path, image_meta, disk_info)
self._set_features(guest, instance.os_type, caps, virt_type,
@ -6335,7 +6321,7 @@ class LibvirtDriver(driver.ComputeDriver):
@staticmethod
def _guest_add_spice_channel(guest):
if (CONF.spice.enabled and CONF.spice.agent_enabled and
guest.virt_type not in ('lxc', 'uml', 'xen')):
guest.virt_type not in ('lxc', 'xen')):
channel = vconfig.LibvirtConfigGuestChannel()
channel.type = 'spicevmc'
channel.target_name = "com.redhat.spice.0"
@ -6403,13 +6389,13 @@ class LibvirtDriver(driver.ComputeDriver):
# those versions are. We'll just let libvirt report the
# errors appropriately if the user enables both.
add_video_driver = False
if CONF.vnc.enabled and guest.virt_type not in ('lxc', 'uml'):
if CONF.vnc.enabled and guest.virt_type not in ('lxc',):
graphics = vconfig.LibvirtConfigGuestGraphics()
graphics.type = "vnc"
graphics.listen = CONF.vnc.server_listen
guest.add_device(graphics)
add_video_driver = True
if CONF.spice.enabled and guest.virt_type not in ('lxc', 'uml', 'xen'):
if CONF.spice.enabled and guest.virt_type not in ('lxc', 'xen'):
graphics = vconfig.LibvirtConfigGuestGraphics()
graphics.type = "spice"
graphics.listen = CONF.spice.server_listen

View File

@ -238,8 +238,7 @@ def pick_disk_driver_name(
return "file"
elif CONF.libvirt.virt_type in ('kvm', 'qemu'):
return "qemu"
else:
# UML doesn't want a driver_name set
else: # parallels
return None

View File

@ -74,7 +74,6 @@ SUPPORTED_VIF_MODELS = {
network_model.VIF_MODEL_RTL8139,
network_model.VIF_MODEL_E1000],
'lxc': [],
'uml': [],
'parallels': [
network_model.VIF_MODEL_VIRTIO,
network_model.VIF_MODEL_RTL8139,

View File

@ -0,0 +1,5 @@
---
upgrade:
- |
Support for the libvirt+UML hypervisor model has been removed. This has not
been validated in some time and was never intended for production use.