Commit 59ffcc20 authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

Add backend method for removing a vm's nic

parent 3c34cd6c
......@@ -486,6 +486,16 @@ def disconnect_from_network(vm, network):
return job
def disconnect_nic_from_vm(vm, nic):
"""Remove a NetworkInterface from a VirtualMachine.
op = [('remove', nic.index, {})]
return vm.client.ModifyInstance(vm.backend_vm_id, nics=op,
hotplug=True, dry_run=settings.TEST)
def _delete_network(network, backend_jobs=None):
if not backend_jobs:
backend_jobs = [(backend, []) for backend in
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