Пример #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
Пример #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
Пример #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
Пример #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