nova/releasenotes/notes/libvirt-store-and-change-default-machine-type-bf86b4973c4dee4c.yaml
Lee Yarwood 8cddd243bf nova-status: Add hw_machine_type check for libvirt instances
This change introduces a new nova-status check to ensure a machine type
has been recorded for each instance within an environment.

nova-status will fail with a warning when instances are found, directing
the operator to use the previously added nova-manage list_unset and
update commands to set a machine type for these instances. The logic for
this check comes entirely from the list_unset command.

It is noted in the warning output that this can be ignored if no libvirt
or HyperV based computes are present in the environment as
hw_machine_type is only used by these two virt drivers at present.

blueprint: libvirt-default-machine-type
Change-Id: Ic3ae48c57e61c4e45883fbae1328a448be025953
2021-03-03 14:03:49 +00:00

54 lines
2.2 KiB
YAML

---
upgrade:
- |
The libvirt virt driver will now attempt to record the machine type of an
instance at startup and when launching an instance if the machine type is
not already recorded in the image metadata associated with the instance.
This machine type will then be used when the instance is restarted or
migrated as it will now appear as an image metadata property associated
with the instance.
The following new ``nova-manage`` commands have been introduced to help
operators manage the ``hw_machine_type`` image property:
``nova-manage libvirt get_machine_type``
This command will print the current machine type if set in the image
metadata of the instance.
``nova-manage libvirt set_machine_type``
This command will set or update the machine type of the instance assuming
the following criteria are met:
* The instance must have a ``vm_state`` of ``STOPPED``, ``SHELVED`` or
``SHELVED_OFFLOADED``.
* The machine type is supported. The supported list includes alias and
versioned types of ``pc``, ``pc-i440fx``, ``pc-q35``, ``q35``, ``virt``,
``s390-ccw-virtio``, ``hyperv-gen1`` and ``hyperv-gen2`` as supported by
the hyperv driver.
* The update will not move the instance between underlying machine types.
For example, ``pc`` to ``q35``.
* The update will not move the instance between an alias and versioned
machine type or vice versa. For example, ``pc`` to ``pc-1.2.3`` or
``pc-1.2.3`` to ``pc``.
A ``--force`` flag is provided to skip the above checks but caution
should be taken as this could easily lead to the underlying ABI of the
instance changing when moving between machine types.
``nova-manage libvirt list_unset_machine_type``
This command will list instance UUIDs that do not have a machine type
recorded. An optional cell UUID can be provided to list on instances
without a machine type from that cell.
A new ``nova-status`` check has been introduced to help operators
identify if any instances within their environment have ``hw_machine_type``
unset before they attempt to change the ``[libvirt]hw_machine_type``
configurable.