Esempio n. 1
0
def delete(dom):
    """Delete given libvirt domain"""
    name = dom.name()
    if queries.get_vm_state(name) == 1:
        dom.destroy()
    dom.undefine()
    queries.delete_vm(name)
    res = 'VM {} was destroyed'.format(name)
    return res
Esempio n. 2
0
def delete(dom):
    """Delete given libvirt domain"""
    name = dom.name()
    if queries.get_vm_state(name) == 1:
        dom.destroy()
    dom.undefine()
    queries.delete_vm(name)
    res = 'VM {} was destroyed'.format(name)
    return res
Esempio n. 3
0
def delete(name, **kwargs):
    """Delete given libvirt domain"""
    dom = defineDomain(name)
    if queries.get_vm_state(name) == 1:
        dom.destroy()
    mac = getMAC(name)
    queries.unAssignIP(mac)
    queries.delete_vm(name)
    manageBridges.delConfHost(mac)  # send
    res = 'VM {} was destroyed'.format(name)
    dom.undefine()
    return res
Esempio n. 4
0
def delete(name, **kwargs):
    """Delete given libvirt domain"""
    dom = defineDomain(name)
    if queries.get_vm_state(name) == 1:
        dom.destroy()
    mac = getMAC(name)
    queries.unAssignIP(mac)
    queries.delete_vm(name)
    manageBridges.delConfHost(mac)      # send
    res = 'VM {} was destroyed'.format(name)
    dom.undefine()
    return res