Browse Source

Merge "trivial: Final cleanup"

changes/42/663542/9
Zuul 1 week ago
committed by Gerrit Code Review
parent
commit
90777d790d
10 changed files with 31 additions and 40 deletions
  1. +1
    -2
      api-ref/source/servers-admin-action.inc
  2. +0
    -1
      nova/api/openstack/compute/agents.py
  3. +2
    -2
      nova/compute/manager.py
  4. +5
    -6
      nova/conf/netconf.py
  5. +14
    -15
      nova/image/glance.py
  6. +1
    -2
      nova/objects/fields.py
  7. +3
    -3
      nova/tests/unit/test_hacking.py
  8. +5
    -6
      nova/virt/driver.py
  9. +0
    -1
      nova/virt/libvirt/driver.py
  10. +0
    -2
      nova/virt/powervm/disk/driver.py

+ 1
- 2
api-ref/source/servers-admin-action.inc View File

@@ -179,8 +179,7 @@ Resets networking on a server.

.. note::

Only the XenServer driver implements this feature and only if the guest
has the XenAPI agent in the targeted server.
No longer supported by any in-tree virt driver.

Specify the ``resetNetwork`` action in the request body.



+ 0
- 1
nova/api/openstack/compute/agents.py View File

@@ -37,7 +37,6 @@ class AgentController(wsgi.Controller):

You can find the design of agent update in this link:
http://wiki.openstack.org/AgentUpdate
and find the code in nova.virt.xenapi.vmops.VMOps._boot_new_instance.
In this design We need update agent in guest from host, so we need
some interfaces to update the agent info in host.



+ 2
- 2
nova/compute/manager.py View File

@@ -8419,8 +8419,8 @@ class ComputeManager(manager.Manager):
"""
# NOTE(pkoniszewski): block migration specific params are set inside
# migrate_data objects for drivers that expose block live migration
# information (i.e. Libvirt, Xenapi and HyperV). For other drivers
# cleanup is not needed.
# information (i.e. Libvirt, HyperV). For other drivers cleanup is not
# needed.
do_cleanup = False
destroy_disks = False
if isinstance(migrate_data, migrate_data_obj.LibvirtLiveMigrateData):


+ 5
- 6
nova/conf/netconf.py View File

@@ -68,8 +68,7 @@ Possible values:

* String with hostname, FQDN or IP address. Default is hostname of this host.
"""),
# TODO(sfinucan): This option is tied into the XenAPI, VMWare and Libvirt
# drivers.
# TODO(sfinucan): This option is tied into the VMWare and Libvirt drivers.
# We should remove this dependency by either adding a new opt for each
# driver or simply removing the offending code. Until then we cannot
# deprecate this option.
@@ -78,10 +77,10 @@ Possible values:
help="""
This option determines whether the network setup information is injected into
the VM before it is booted. While it was originally designed to be used only
by nova-network, it is also used by the vmware and xenapi virt drivers to
control whether network information is injected into a VM. The libvirt virt
driver also uses it when we use config_drive to configure network to control
whether network information is injected into a VM.
by nova-network, it is also used by the vmware virt driver to control whether
network information is injected into a VM. The libvirt virt driver also uses it
when we use config_drive to configure network to control whether network
information is injected into a VM.
"""),
]



+ 14
- 15
nova/image/glance.py View File

@@ -597,7 +597,7 @@ class GlanceImageServiceV2(object):
"""
# These preferred disk formats are in order:
# 1. we want qcow2 if possible (at least for backward compat)
# 2. vhd for xenapi and hyperv
# 2. vhd for hyperv
# 3. vmdk for vmware
# 4. raw should be universally accepted
preferred_disk_formats = (
@@ -1276,20 +1276,19 @@ class API(object):
Note that because of the poor design of the
`glance.ImageService.download` method, the function returns different
things depending on what arguments are passed to it. If a data argument
is supplied but no dest_path is specified (only done in the XenAPI virt
driver's image.utils module) then None is returned from the method. If
the data argument is not specified but a destination path *is*
specified, then a writeable file handle to the destination path is
constructed in the method and the image bits written to that file, and
again, None is returned from the method. If no data argument is
supplied and no dest_path argument is supplied (VMWare and XenAPI virt
drivers), then the method returns an iterator to the image bits that
the caller uses to write to wherever location it wants. Finally, if the
allow_direct_url_schemes CONF option is set to something, then the
nova.image.download modules are used to attempt to do an SCP copy of
the image bits from a file location to the dest_path and None is
returned after retrying one or more download locations (libvirt and
Hyper-V virt drivers through nova.virt.images.fetch).
is supplied but no dest_path is specified (not currently done by any
caller) then None is returned from the method. If the data argument is
not specified but a destination path *is* specified, then a writeable
file handle to the destination path is constructed in the method and
the image bits written to that file, and again, None is returned from
the method. If no data argument is supplied and no dest_path argument
is supplied (VMWare virt driver), then the method returns an iterator
to the image bits that the caller uses to write to wherever location it
wants. Finally, if the allow_direct_url_schemes CONF option is set to
something, then the nova.image.download modules are used to attempt to
do an SCP copy of the image bits from a file location to the dest_path
and None is returned after retrying one or more download locations
(libvirt and Hyper-V virt drivers through nova.virt.images.fetch).

I think the above points to just how hacky/wacky all of this code is,
and the reason it needs to be cleaned up and standardized across the


+ 1
- 2
nova/objects/fields.py View File

@@ -382,8 +382,7 @@ class HVType(BaseNovaEnum):
Provide the standard names for all known guest virtualization
types. This is not to be confused with the Nova hypervisor driver
types, since one driver may support multiple virtualization types
and one virtualization type (eg 'xen') may be supported by multiple
drivers ('XenAPI' or 'Libvirt-Xen').
and one virtualization type may be supported by multiple drivers.
"""

BAREMETAL = 'baremetal'


+ 3
- 3
nova/tests/unit/test_hacking.py View File

@@ -57,11 +57,11 @@ class HackingTestCase(test.NoDBTestCase):

self.assertEqual(expect, checks.import_no_virt_driver_import_deps(
"from nova.virt.libvirt import utils as libvirt_utils",
"./nova/virt/xenapi/driver.py"))
"./nova/virt/hyperv/driver.py"))

self.assertEqual(expect, checks.import_no_virt_driver_import_deps(
"import nova.virt.libvirt.utils as libvirt_utils",
"./nova/virt/xenapi/driver.py"))
"./nova/virt/hyperv/driver.py"))

self.assertIsNone(checks.import_no_virt_driver_import_deps(
"from nova.virt.libvirt import utils as libvirt_utils",
@@ -71,7 +71,7 @@ class HackingTestCase(test.NoDBTestCase):
self.assertIsInstance(checks.import_no_virt_driver_config_deps(
"CONF.import_opt('volume_drivers', "
"'nova.virt.libvirt.driver', group='libvirt')",
"./nova/virt/xenapi/driver.py"), tuple)
"./nova/virt/hyperv/driver.py"), tuple)

self.assertIsNone(checks.import_no_virt_driver_config_deps(
"CONF.import_opt('volume_drivers', "


+ 5
- 6
nova/virt/driver.py View File

@@ -138,8 +138,8 @@ class ComputeDriver(object):
"""Base class for compute drivers.

The interface to this class talks in terms of 'instances' (Amazon EC2 and
internal Nova terminology), by which we mean 'running virtual machine'
(XenAPI terminology) or domain (Xen or libvirt terminology).
internal Nova terminology), by which we mean 'running virtual machine' or
domain (libvirt terminology).

An instance has an ID, which is the identifier chosen by Nova to represent
the instance further up the stack. This is unfortunately also called a
@@ -1526,10 +1526,9 @@ class ComputeDriver(object):

All counters are long integers.

This method is optional. On some platforms (e.g. XenAPI) performance
statistics can be retrieved directly in aggregate form, without Nova
having to do the aggregation. On those platforms, this method is
unused.
This method is optional. On some platforms performance statistics can
be retrieved directly in aggregate form, without Nova having to do the
aggregation. On those platforms, this method is unused.

Note that this function takes an instance ID.



+ 0
- 1
nova/virt/libvirt/driver.py View File

@@ -2624,7 +2624,6 @@ class LibvirtDriver(driver.ComputeDriver):
elif not CONF.libvirt.virt_type == 'parallels':
raise exception.SetAdminPasswdNotSupported()

# TODO(melwitt): Combine this with the similar xenapi code at some point.
def _save_instance_password_if_sshkey_present(self, instance, new_pass):
sshkey = instance.key_data if 'key_data' in instance else None
if sshkey and sshkey.startswith("ssh-rsa"):


+ 0
- 2
nova/virt/powervm/disk/driver.py View File

@@ -40,8 +40,6 @@ class IterableToFileAdapter(object):

The Glance client returns an iterable, but PowerVM requires a file. This
is the adapter between the two.

Taken from xenapi/image/apis.py
"""

def __init__(self, iterable):


Loading…
Cancel
Save