---
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.
