Commit 9ad51df0 authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

Add setting indicating whether to use hotplug

parent 2ae2ac99
......@@ -34,6 +34,10 @@ GANETI_CREATEINSTANCE_KWARGS = {
'hvparams': {'serial_console': False},
'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.
GANETI_USE_HOTPLUG = 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
......
......@@ -537,7 +537,8 @@ def disconnect_from_network(vm, nic):
op = [('remove', nic.index, {})]
return vm.client.ModifyInstance(vm.backend_vm_id, nics=op,
hotplug=True, dry_run=settings.TEST)
hotplug=settings.GANETI_USE_HOTPLUG,
dry_run=settings.TEST)
def _delete_network(network, backend_jobs=None):
......@@ -560,7 +561,8 @@ def connect_to_network(vm, network, address):
nic = {'ip': address, 'network': network.backend_id}
vm.client.ModifyInstance(vm.backend_vm_id, nics=[('add', nic)],
hotplug=True, dry_run=settings.TEST)
hotplug=settings.GANETI_USE_HOTPLUG,
dry_run=settings.TEST)
def set_firewall_profile(vm, profile):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment