[Engine-devel] Problem with detachment of host interface using ovirt-sdk

Itzik Brown ItzikB at mellanox.com
Sun Apr 29 08:44:54 UTC 2012


Juan,

I used the repository git://gerrit.ovirt.org/ovirt-engine-sdk
Commit 3c721e60ab3af3ad07e1a20bc6fdbcdbc1344df0

The test script :

#!/usr/bin/python

import sys
from ovirtsdk.api import API
from ovirtsdk.xml import params

OVIRT_ENGINE_SERVER = 'server1'
OVIRT_ENGINE_PORT = '8080'
OVIRT_ENGINE_USER = 'admin at internal'
OVIRT_ENGINE_PASSWORD = 'password'

url = 'http://%s:%s' % (OVIRT_ENGINE_SERVER, OVIRT_ENGINE_PORT)
api = API(url = url, username = OVIRT_ENGINE_USER , password = OVIRT_ENGINE_PASSWORD)

host = 'host1'
if_name = 'eth4'
net_name = 'net1'
nic = api.hosts.get(name=host).nics.get(name=if_name)
net = params.Network(name=net_name)
act = params.Action(network=net)
nic.detach(act)
api.hosts.get(name=host).commitnetconfig()

Thanks,
Itzik



More information about the Engine-devel mailing list