This is a multi-part message in MIME format.
--------------3C1AEAC84EB8A9617AC38ED6
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: quoted-printable
Hi I managed to create my dhcp hostnic thanks to the python script, but=20
the same with ovirt-shell:
* [oVirt shell (connected) # add networkattachment --parent-host-name
taal --network-name brv106 --host_nic-name enp2s0f0 =3D> OK but I
didn't find any way to add boot protocol to DHCP
* [oVirt shell (connected)]# add networkattachment --parent-host-name
taal --network-name brv106 --host_nic-name enp2s0f0
--ip_address_assignments-ip_address_assignment dhcp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ERROR=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D
"dhcp" is invalid segment at option=20
"--ip_address_assignments-ip_address_assignment".
* [oVirt shell (connected)]# update nic enp3s0f0 --parent-host-name
zonda --network-name brv106 --boot_protocol dhcp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ERROR=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D
status: 405
reason: Method Not Allowed
detail:
Should be much simpler via CLI to do such a thing, what's wrong there?
Le 15/01/2016 =E0 12:20, Juan Hern=E1ndez a =E9crit :
On 01/14/2016 01:28 PM, Bloemen, Jurri=EBn wrote:
>> On 14-01-16 12:16, Juan Hern=E1ndez wrote:
>>> On 01/14/2016 11:24 AM, Bloemen, Jurri=EBn wrote:
>>>> Hi,
>>>>
>>>> First I created a bonding interface:
>>>>
>>>> # add nic --parent-host-name server01 --name bond0 --network-name
>>>> VLAN602 --bonding-slaves-host_nic host_nic.name=3Deno1
>>>> --bonding-slaves-host_nic host_nic.name=3Deno2
>>>>
>>>> This works great but no IP is set on VLAN602.
>>>>
>>>> Then I'm trying to add an ip address to a network with the followin=
g
>>>> command:
>>>>
>>>> # update hostnic --parent-host-name server01 --network-name VLAN602
>>>> --boot_protocol static --ip-address 10.10.10.10 --ip-netmask 255.25=
5.255.0
>>>>
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>>> ERROR
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>>>
=
=20
>>>> wrong number of arguments, try 'help update'
for help.
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
rtualization/3.6-Beta/html/RHEVM_Shell_Guide/nic.html
>>>> I need to use "nic" instead of
"hostnic" but then I don't have the
>>>> options to say this is a --parent-host-name. Only VM related comman=
d
>>>> options.
>>>>
>>>> So I think the documentation is behind.
>>>>
>>>> Can somebody help me with what the command is to add a IP to a
>>>> VLAN/Network for a host?
>>>>
>>>>
>>> The command should be like this:
>>>
>>> # update nic bond0 --parent-host-name server01 --network-name VLA=
N602
>>> --boot_protocol static --ip-address 10.10.10.10
--ip-netmask 255.255=
.255.0
>>>
>>> Note that the it is "nic" instead of "hostnic" and that
you need to
>>> specify the name of that NIC, in this case "bond0".
>>>
>>> The command will work if you type it like that, but auto-completion
>>> won't work. This is a bug in the CLI, indirectly caused by the fact =
that
>>> the name of the URL segment used in the RESTAPI is
"nics" (from
>>> /hosts/{host:id}/*nics*) but the name of the XML schema complex type=
is
>>> "HostNIC".
>>>
>> Thanks! That works!
>>
>> Another question:
>>
>> Now I got the message that my network is out-of-sync. How can i force
>> within the ovirt-shell that it syncs the networks?
> hmz.... pressed sent by accident
>
> What I want to say is:
>
> Now I got the message that my network is out-of-sync. How can i force
> within the ovirt-shell that it syncs the networks?
> Because when I press "Sync All Networks" the IP address disappears....
>
> But when I check the box "Sync Network" within the VLAN602 options it
> gets pushed to the host.
>
> Is there a difference between the both? And how do I run both via
> ovirt-shell?
>
The "sync network" operation is not supported by ovirt-shell.
If you want to set the network configuration, and make it persistent,
then you will need to use one of the "setupNetworks" operations. These
aren't fully usable with ovirt-shell either, so if you want to use it
you will need to use directly the API or one of the SDKs. For example,
lets assume that you have a host with network interfaces eth0, eth1, an=
d
eth2, and that you want to configure eth1 and eth2 as a bond, to put
your VLAN and IP address on top. You can do that with a script like thi=
s:
---8<---
#!/bin/sh -ex
url=3D"https://engine.example.com/ovirt-engine/api"
user=3D"admin@internal"
password=3D"..."
curl \
--verbose \
--cacert /etc/pki/ovirt-engine/ca.pem \
--user "${user}:${password}" \
--request POST \
--header "Content-Type: application/xml" \
--header "Accept: application/xml" \
--data '
<action>
<modified_network_attachments>
<network_attachment>
<network>
<name>VLAN602</name>
</network>
<host_nic>
<name>bond0</name>
</host_nic>
<ip_address_assignments>
<assignment_method>static</assignment_method>
<ip_address_assignment>
<ip netmask=3D"255.255.255.0"
address=3D"10.10.10.10"/>
</ip_address_assignment>
</ip_address_assignments>
</network_attachment>
</modified_network_attachments>
<modified_bonds>
<host_nic>
<name>bond0</name>
<bonding>
<options>
<option name=3D"mode" value=3D"4"/>
<option name=3D"miimon" value=3D"100"/>
</options>
<slaves>
<host_nic>
<name>eth1</name>
</host_nic>
<host_nic>
<name>eth2</name>
</host_nic>
</slaves>
</bonding>
</host_nic>
</modified_bonds>
</action>
' \
"${url}/1ff7a191-2f3b-4eff-812b-9f91a30c3acc/setupnetworks"
--->8---
If you prefer to use one of the SDKs, the Python SDK for example, then
it should look like this:
---8<---
#!/usr/bin/python
from ovirtsdk.api import API
from ovirtsdk.xml import params
# Connect to the server:
api =3D API(
url=3D"https://engine.example.com/ovirt-engine/api",
username=3D"admin@internal",
password=3D"...",
ca_file=3D"/etc/pki/ovirt-engine/ca.pem",
debug=3DTrue
)
# Find the host:
host =3D api.hosts.get(name=3D"myhost")
# Set up the networks:
host.setupnetworks(
params.Action(
modified_bonds=3Dparams.HostNics(
host_nic=3D[
params.HostNIC(
name=3D"bond0",
bonding=3Dparams.Bonding(
options=3Dparams.Options(
option=3D[
params.Option(name=3D"mode", value=3D"4"),
params.Option(name=3D"miimon", value=3D"100"),
],
),
slaves=3Dparams.Slaves(
host_nic=3D[
params.HostNIC(name=3D"eth1"),
params.HostNIC(name=3D"eth2"),
],
),
),
),
],
),
modified_network_attachments=3Dparams.NetworkAttachments(
network_attachment=3D[
params.NetworkAttachment(
network=3Dparams.Network(name=3D"VLAN602"),
host_nic=3Dparams.HostNIC(name=3D"bond0"),
ip_address_assignments=3Dparams.IpAddressAssignments(
ip_address_assignment=3D[
params.IpAddressAssignment(
assignment_method=3D"static",
ip=3Dparams.IP(
address=3D"10.10.10.10",
netmask=3D"255.255.255.0",
),
),
],
),
),
],
),
),
)
# Close the connection:
api.disconnect()
---8<---
--=20
Nathana=EBl Blanchet
Supervision r=E9seau
P=F4le Infrastrutures Informatiques
227 avenue Professeur-Jean-Louis-Viala
34193 MONTPELLIER CEDEX 5 =09
T=E9l. 33 (0)4 67 54 84 55
Fax 33 (0)4 67 54 84 14
blanchet(a)abes.fr
--------------3C1AEAC84EB8A9617AC38ED6
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<meta content=3D"text/html; charset=3Dwindows-1252"
http-equiv=3D"Content-Type">
</head>
<body bgcolor=3D"#FFFFFF" text=3D"#000000">
<p>Hi I managed to create my dhcp hostnic thanks to the python
script, but the same with ovirt-shell:</p>
<ul>
<li>[oVirt shell (connected) # add networkattachment
--parent-host-name taal --network-name brv106 --host_nic-name
enp2s0f0 =3D> OK but I didn't find any way to add boot protoco=
l
to DHCP</li>
</ul>
<ul>
<li>[oVirt shell (connected)]# add networkattachment
--parent-host-name taal --network-name brv106 --host_nic-name
enp2s0f0 --ip_address_assignments-ip_address_assignment dhcp</li>
</ul>
<p>=A0 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
ERROR =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 "dhcp"=
is invalid segment at option
"--ip_address_assignments-ip_address_assignment".<br>
</p>
<ul>
<li>[oVirt shell (connected)]# update nic enp3s0f0
--parent-host-name zonda --network-name brv106 --boot_protocol
dhcp</li>
</ul>
<p>=A0 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
ERROR =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br>
=A0 status: 405<br>
=A0 reason: Method Not Allowed<br>
=A0 detail:<br>
</p>
<br>
Should be much simpler via CLI to do such a thing, what's wrong
there?<br>
<br>
<div class=3D"moz-cite-prefix">Le 15/01/2016 =E0 12:20, Juan
Hern=E1n=
dez a
=E9crit=A0:<br>
</div>
<blockquote cite=3D"mid:5698D5F1.3070300@redhat.com"
type=3D"cite">
<pre wrap=3D"">On 01/14/2016 01:28 PM, Bloemen, Jurri=EBn wrote:
</pre>
<blockquote type=3D"cite">
<blockquote type=3D"cite">
<pre wrap=3D"">
On 14-01-16 12:16, Juan Hern=E1ndez wrote:
</pre>
<blockquote type=3D"cite">
<pre wrap=3D"">On 01/14/2016 11:24 AM, Bloemen, Jurri=EBn
wro=
te:
</pre>
<blockquote type=3D"cite">
<pre wrap=3D"">Hi,
First I created a bonding interface:
# add nic --parent-host-name server01 --name bond0 --network-name
VLAN602 --bonding-slaves-host_nic host_nic.name=3Deno1
--bonding-slaves-host_nic host_nic.name=3Deno2
This works great but no IP is set on VLAN602.
Then I'm trying to add an ip address to a network with the following
command:
# update hostnic --parent-host-name server01 --network-name VLAN602
--boot_protocol static --ip-address 10.10.10.10 --ip-netmask 255.255.255.=
0
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
ERROR
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D
=
=20
wrong number of arguments, try 'help update' for help.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Looking at this document
<a class=3D"moz-txt-link-freetext"
href=3D"https://access.redhat.com/docu=
mentation/en-US/Red_Hat_Enterprise_Virtualization/3.6-Beta/html/RHEVM_She=
ll_Guide/nic.html">https://access.redhat.com/documentation/en-US/...
Enterprise_Virtualization/3.6-Beta/html/RHEVM_Shell_Guide/nic.html</a>
I need to use "nic" instead of "hostnic" but then I don't have
the
options to say this is a --parent-host-name. Only VM related command
options.
So I think the documentation is behind.
Can somebody help me with what the command is to add a IP to a
VLAN/Network for a host?
</pre>
</blockquote>
<pre wrap=3D"">The command should be like this:
# update nic bond0 --parent-host-name server01 --network-name VLAN602
--boot_protocol static --ip-address 10.10.10.10 --ip-netmask 255.255.255.=
0
Note that the it is "nic" instead of "hostnic" and that you need to
specify the name of that NIC, in this case "bond0".
The command will work if you type it like that, but auto-completion
won't work. This is a bug in the CLI, indirectly caused by the fact that
the name of the URL segment used in the RESTAPI is "nics" (from
/hosts/{host:id}/*nics*) but the name of the XML schema complex type is
"HostNIC".
</pre>
</blockquote>
<pre wrap=3D"">Thanks! That works!
Another question:
Now I got the message that my network is out-of-sync. How can i force
within the ovirt-shell that it syncs the networks?
</pre>
</blockquote>
<pre wrap=3D"">
hmz.... pressed sent by accident
What I want to say is:
Now I got the message that my network is out-of-sync. How can i force
within the ovirt-shell that it syncs the networks?
Because when I press "Sync All Networks" the IP address disappears....
But when I check the box "Sync Network" within the VLAN602 options it
gets pushed to the host.
Is there a difference between the both? And how do I run both via
ovirt-shell?
</pre>
</blockquote>
<pre wrap=3D"">
The "sync network" operation is not supported by ovirt-shell.
If you want to set the network configuration, and make it persistent,
then you will need to use one of the "setupNetworks" operations. These
aren't fully usable with ovirt-shell either, so if you want to use it
you will need to use directly the API or one of the SDKs. For example,
lets assume that you have a host with network interfaces eth0, eth1, and
eth2, and that you want to configure eth1 and eth2 as a bond, to put
your VLAN and IP address on top. You can do that with a script like this:
---8<---
#!/bin/sh -ex
url=3D<a class=3D"moz-txt-link-rfc2396E"
href=3D"https://engine.example.c=
om/ovirt-engine/api">"https://engine.example.com/ovirt-engin...
user=3D"admin@internal"
password=3D"..."
curl \
--verbose \
--cacert /etc/pki/ovirt-engine/ca.pem \
--user "${user}:${password}" \
--request POST \
--header "Content-Type: application/xml" \
--header "Accept: application/xml" \
--data '
<action>
<modified_network_attachments>
<network_attachment>
<network>
<name>VLAN602</name>
</network>
<host_nic>
<name>bond0</name>
</host_nic>
<ip_address_assignments>
<assignment_method>static</assignment_method>
<ip_address_assignment>
<ip netmask=3D"255.255.255.0"
address=3D"10.10.10.10"/>
</ip_address_assignment>
</ip_address_assignments>
</network_attachment>
</modified_network_attachments>
<modified_bonds>
<host_nic>
<name>bond0</name>
<bonding>
<options>
<option name=3D"mode" value=3D"4"/>
<option name=3D"miimon" value=3D"100"/>
</options>
<slaves>
<host_nic>
<name>eth1</name>
</host_nic>
<host_nic>
<name>eth2</name>
</host_nic>
</slaves>
</bonding>
</host_nic>
</modified_bonds>
</action>
' \
"${url}/1ff7a191-2f3b-4eff-812b-9f91a30c3acc/setupnetworks"
--->8---
If you prefer to use one of the SDKs, the Python SDK for example, then
it should look like this:
---8<---
#!/usr/bin/python
from ovirtsdk.api import API
from ovirtsdk.xml import params
# Connect to the server:
api =3D API(
url=3D<a class=3D"moz-txt-link-rfc2396E"
href=3D"https://engine.examp=
le.com/ovirt-engine/api">"https://engine.example.com/ovirt-e...
,
username=3D"admin@internal",
password=3D"...",
ca_file=3D"/etc/pki/ovirt-engine/ca.pem",
debug=3DTrue
)
# Find the host:
host =3D api.hosts.get(name=3D"myhost")
# Set up the networks:
host.setupnetworks(
params.Action(
modified_bonds=3Dparams.HostNics(
host_nic=3D[
params.HostNIC(
name=3D"bond0",
bonding=3Dparams.Bonding(
options=3Dparams.Options(
option=3D[
params.Option(name=3D"mode", value=3D"4"),
params.Option(name=3D"miimon", value=3D"100"),
],
),
slaves=3Dparams.Slaves(
host_nic=3D[
params.HostNIC(name=3D"eth1"),
params.HostNIC(name=3D"eth2"),
],
),
),
),
],
),
modified_network_attachments=3Dparams.NetworkAttachments(
network_attachment=3D[
params.NetworkAttachment(
network=3Dparams.Network(name=3D"VLAN602"),
host_nic=3Dparams.HostNIC(name=3D"bond0"),
ip_address_assignments=3Dparams.IpAddressAssignments(
ip_address_assignment=3D[
params.IpAddressAssignment(
assignment_method=3D"static",
ip=3Dparams.IP(
address=3D"10.10.10.10",
netmask=3D"255.255.255.0",
),
),
],
),
),
],
),
),
)
# Close the connection:
api.disconnect()
---8<---
</pre>
</blockquote>
<br>
<pre class=3D"moz-signature" cols=3D"72">--=20
Nathana=EBl Blanchet
Supervision r=E9seau
P=F4le Infrastrutures Informatiques
227 avenue Professeur-Jean-Louis-Viala
34193 MONTPELLIER CEDEX 5 =09
T=E9l. 33 (0)4 67 54 84 55
Fax 33 (0)4 67 54 84 14
<a class=3D"moz-txt-link-abbreviated"
href=3D"mailto:blanchet@abes.fr">bl=
anchet(a)abes.fr</a> </pre>
</body>
</html>
--------------3C1AEAC84EB8A9617AC38ED6--