diff --git a/Changelog b/Changelog index 73f49ae3c35dbba7003772be9616b2e675eff7db..0bd53a72805d9f2622f6acbdaf5f555c36957a02 100644 --- a/Changelog +++ b/Changelog @@ -164,6 +164,8 @@ Cyclades are drained. * Fix the'network-inspect' command to not contain externally reserved IPs in th number of available IPs. +* Add `GANETI_DISKS_WAIT_FOR_SYNC` setting to decide whether Ganeti will + wait for the disk mirror to sync (`--no-wait-for-sync` Ganeti option). * Fix mishandling of `MAX_CIDR_BLOCK` setting. Allowed CIDR sizes changed from (MAX_CIDR_BLOCK, 29) to [MAX_CIDR_BLOCK, 29]. * Fix various minor bugs. diff --git a/snf-cyclades-app/conf/20-snf-cyclades-app-backend.conf b/snf-cyclades-app/conf/20-snf-cyclades-app-backend.conf index 778594e153073c30604fc0e11329af0c2df29def..1d9fbb639d4e368d8fe8fcc5464f41a8d1e1cd40 100644 --- a/snf-cyclades-app/conf/20-snf-cyclades-app-backend.conf +++ b/snf-cyclades-app/conf/20-snf-cyclades-app-backend.conf @@ -27,7 +27,7 @@ # 'hvparams': {'kvm': {'serial_console': False}, # 'xen-pvm': {}, # 'xen-hvm': {}}, -# 'wait_for_sync': False} +#} # ## If True, qemu-kvm will hotplug a NIC when connecting a vm to ## a network. This requires qemu-kvm=1.0. @@ -37,6 +37,10 @@ ## not already locked. This might result in slightly unbalanced clusters. #GANETI_USE_OPPORTUNISTIC_LOCKING = True # +## If False, Ganeti will not wait for the disk mirror to sync +## (--no-wait-for-sync option in Ganeti). Useful only for DRBD template. +#GANETI_DISKS_WAIT_FOR_SYNC = False +# ## This module implements the strategy for allocating a vm to a backend #BACKEND_ALLOCATOR_MODULE = "synnefo.logic.allocators.default_allocator" ## Refresh backend statistics timeout, in minutes, used in backend allocation diff --git a/snf-cyclades-app/synnefo/app_settings/default/backend.py b/snf-cyclades-app/synnefo/app_settings/default/backend.py index 26d35b1bfba390a503d1e02f4e10933c7a09598c..16b2adf551f9ce9f8278a54b9312f64514be7c0c 100644 --- a/snf-cyclades-app/synnefo/app_settings/default/backend.py +++ b/snf-cyclades-app/synnefo/app_settings/default/backend.py @@ -27,7 +27,7 @@ GANETI_CREATEINSTANCE_KWARGS = { 'hvparams': {"kvm": {'serial_console': False}, "xen-pvm": {}, "xen-hvm": {}}, - 'wait_for_sync': False} +} # If True, qemu-kvm will hotplug a NIC when connecting a vm to # a network. This requires qemu-kvm=1.0. @@ -37,6 +37,10 @@ GANETI_USE_HOTPLUG = True # not already locked. This might result in slightly unbalanced clusters. GANETI_USE_OPPORTUNISTIC_LOCKING = True +# If False, Ganeti will not wait for the disk mirror to sync +# (--no-wait-for-sync option in Ganeti). Useful only for DRBD template. +GANETI_DISKS_WAIT_FOR_SYNC = False + # This module implements the strategy for allocating a vm to a backend BACKEND_ALLOCATOR_MODULE = "synnefo.logic.allocators.default_allocator" # Refresh backend statistics timeout, in minutes, used in backend allocation diff --git a/snf-cyclades-app/synnefo/logic/backend.py b/snf-cyclades-app/synnefo/logic/backend.py index ad2c287de726493ba0df1269e5c20ec3f822c1f9..a9e721a035d930c61d1ba1084c38c72d860a3acd 100644 --- a/snf-cyclades-app/synnefo/logic/backend.py +++ b/snf-cyclades-app/synnefo/logic/backend.py @@ -808,6 +808,9 @@ def create_instance(vm, nics, volumes, flavor, image): kw["disks"] = disks + # --no-wait-for-sync option for DRBD disks + kw["wait_for_sync"] = settings.GANETI_DISKS_WAIT_FOR_SYNC + kw['nics'] = [{"name": nic.backend_uuid, "network": nic.network.backend_id, "ip": nic.ipv4_address} @@ -1216,6 +1219,7 @@ def attach_volume(vm, volume, depends=[]): kwargs = { "instance": vm.backend_vm_id, "disks": [("add", "-1", disk)], + "wait_for_sync": settings.GANETI_DISKS_WAIT_FOR_SYNC, "depends": depends, } if vm.backend.use_hotplug():