Add nova_libvirt_live_migration_flag variable

Currently live_migration_flag is only written to nova.conf if Ceph is
in use.  However, there may be other use cases using live migrations
where being able to override this is necessary.  This commit introduces
a new variable called nova_libvirt_live_migration_flag and writes
live_migration_flag to nova.conf irrespective of whether Ceph is in
use.  We also relocate nova_libvirt_disk_cachemodes and
nova_libvirt_hw_disk_discard in defaults/main.yml so that these
defaults sit with the other nova_libvirt defaults.

NOTE: We change the live_migration_flag defaults here to match nova's
      defaults.  Several Ceph resources suggest to use
      VIR_MIGRATE_PERSIST_DEST however in my limited testing this did
      not appear to be necessary.  We can update the default or amend
      it when using Ceph if we find that it is in fact necessary.

Closes-Bug: #1484439
Change-Id: I1baa9d590ae90ca45c763c8a5e6546c4825eabfe
This commit is contained in:
Matt Thompson 2015-08-13 11:17:57 +01:00
parent de8fd1e2f8
commit ce6b8d59dd
2 changed files with 4 additions and 3 deletions

View File

@ -182,6 +182,9 @@ nova_libvirt_inject_key: False
# -2 => disable, -1 => inspect (libguestfs only), 0 => not partitioned, >0 => partition number
nova_libvirt_inject_partition: -2
nova_libvirt_inject_password: False
nova_libvirt_disk_cachemodes: '{{ nova_libvirt_images_rbd_pool is defined | ternary("network=writeback", "") }}'
nova_libvirt_hw_disk_discard: '{{ nova_libvirt_images_rbd_pool is defined | ternary("unmap", "ignore") }}'
nova_libvirt_live_migration_flag: "VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_TUNNELLED"
## Nova conductor
nova_conductor_program_name: nova-conductor
@ -250,8 +253,6 @@ nova_recreate_keys: False
#nova_libvirt_images_rbd_pool: vms
nova_ceph_client: '{{ cinder_ceph_client }}'
nova_ceph_client_uuid: 517a4663-3927-44bc-9ea7-4a90e1cd4c66
nova_libvirt_disk_cachemodes: '{{ nova_libvirt_images_rbd_pool is defined | ternary("network=writeback", "") }}'
nova_libvirt_hw_disk_discard: '{{ nova_libvirt_images_rbd_pool is defined | ternary("unmap", "ignore") }}'
## General Neutron configuration
# If ``nova_osapi_compute_workers`` is unset the system will use half the number of available VCPUS to

View File

@ -252,7 +252,7 @@ rbd_secret_uuid = {{ nova_ceph_client_uuid }}
images_type = rbd
images_rbd_pool = {{ nova_libvirt_images_rbd_pool }}
images_rbd_ceph_conf = /etc/ceph/ceph.conf
live_migration_flag="VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST"
{% endif %}
live_migration_flag = "{{ nova_libvirt_live_migration_flag }}"
hw_disk_discard = {{ nova_libvirt_hw_disk_discard }}
disk_cachemodes = {{ nova_libvirt_disk_cachemodes }}