--Apple-Mail-89C7D827-97B3-48B9-BD94-15A1C42B97DB
Content-Type: text/plain;
charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Hi All,
I have an issue with the python ovirt sdk.
I made a script that creates a new host, hypervisor, in the ovirt environmen=
t.
The host is created and is put in maintenance state.
So far it works, but then i try to create the networks on the new host and t=
here i got an error.
=20
Creating the host:
=20
try:
if api.hosts.add(pHst):
print("Host was added successfully")
print("Waiting for host, {}, to reach the 'up' or 'non
operati=
onal' status").format(host)
while api.hosts.get(name =3D host).status.state !=3D
'up' and a=
pi.hosts.get(name =3D host).status.state !=3D
'non_operational':
sleep(1)
sleep(5)
print("Host, {}, is '{}'").format(host)
=20
except Exception as e:
print("Failed to install Host: {}").format(str(e))
return None
=20
Host =3D api.hosts.get(name =3D host)
=20
Host.deactivate()
sleep(5)
address, netmask =3D getDefaultAddress(api, oc, DC, host)
if address is not None:
So far all's well.
Then the part for the network...
=20
rc =3D setBondAndDefVLan(api, oc, DC, cluster, host, address, netm=
ask)
if rc is not None:
Host.update()
Host.activate()
=20
---
=20
def setBondParams(api, oc, DC, host):
nic0 =3D params.HostNIC(name =3D oc.nic1,
network =3D params.Network(),
boot_protocol =3D 'none',
ip =3D params.IP(
address =3D '',
netmask =3D '',
gateway =3D '',
),
)
nic1 =3D params.HostNIC(name =3D oc.nic2,
network =3D params.Network(),
boot_protocol =3D 'none',
ip =3D params.IP(
address =3D '',
netmask =3D '',
gateway =3D '',
),
)
=20
bond =3D params.Bonding(slaves =3D params.Slaves(host_nic =3D [
nic0,
nic1,
]),
options =3D params.Options(option =3D [
params.Option=
(name
=3D 'miimon',
=
value =3D '100'),
params.Option=
(name =3D 'mode',
=
value =3D '4'),
])
)
=20
team =3D params.HostNIC(name =3D 'bond0',
boot_protocol =3D 'none',
ip =3D params.IP(
address =3D '=
',
netmask
=3D '=
',
gateway
=3D '=
',
),
override_configuration =3D 1,
bonding =3D bond)
return team
=20
=20
def setDefVLanParams(api, oc, DC, cluster, host, address, netmask):
defvlan =3D oc.defaultvlan
clusterNW =3D api.clusters.get(cluster).networks.get(name =3D defvlan)=
vlan =3D params.HostNIC(name =3D
"bond0.{}".format(c=
lusterNW.vlan.id),
network =3D
params.Network(name =3D=
defvlan),
boot_protocol =3D 'none',
ip =3D params.IP(
address =3D a=
ddress,
netmask
=3D n=
etmask,
gateway
=3D '=
'
),
override_configuration =3D 1,
)
return vlan
=20
=20
def setBondAndDefVLan(api, oc, DC, cluster, host, address, netmask):
try:
Host =3D api.hosts.get(name =3D host)
except Exception as e:
print("Could not find host {}, this is extremly wrong!\n{}").forma=
t(host, str(e))
return None
=20
team =3D setBondParams(api, oc, DC, Host)
vlan =3D setDefVLan(api, oc, DC, cluster, Host, address, netmask)
=20
try:
Host.nics.setupnetworks(params.Action(force =3D 0,
check_connectivity =3D 0,
host_nics =3D params.HostNic=
s(host_nic =3D [
=
team,=20
=
vlan,
=
])
),
)
except Exception as e:
print("Could not setup a management interface for host {}.\n--\n{}=
\n--").format(host, str(e))
return None
=20
return host
=20
=20
The setting for oc.nic1 is 'eno1' and oc.nic2 is 'eno2'.
This part of the script times out on "Host.nics.setupnetworks(...) with:
=20
"Host was added successfully"
"Waiting for host, X, to reach the 'up' or 'non operational'
status"
"Host, X, is 'non_operational'"
=20
"Could not setup a management interface for host X."
"--"
=20
"status: 400"
"reason: Bad Request"
"detail: Network error during communication with the Host."
"--"
=20
The problem with the communication is that on the new host X all the ip co=
nfiguration is gone.
The question i have is "Why is the ip configuration gone?"
What am i donig wrong here?
->Rein.
(vanaf BigI)=
--Apple-Mail-89C7D827-97B3-48B9-BD94-15A1C42B97DB
Content-Type: text/html;
charset=utf-8
Content-Transfer-Encoding: quoted-printable
<html><head><meta http-equiv=3D"content-type"
content=3D"text/html; charset=3D=
utf-8"></head><body dir=3D"auto"><div><span
style=3D"color: rgb(69, 69, 69);=
text-decoration: -webkit-letterpress; background-color: rgba(255, 255, 255,=
0);">Hi All,</span></div><div
id=3D"AppleMailSignature"><font color=3D"#454=
545"><span style=3D"text-decoration:
-webkit-letterpress;"><br></span></font=
<div style=3D"color: rgb(69, 69, 69); text-decoration:
-webkit-letterpress;=
"><span style=3D"background-color: rgba(255,
255, 255, 0);">I have an issue w=
ith the python ovirt sdk.</span></div><div style=3D"color: rgb(69, 69,
69); t=
ext-decoration: -webkit-letterpress;"><span style=3D"background-color:
rgba(=
255, 255, 255, 0);">I made a script that creates a new host, hypervisor, in t=
he ovirt environment.</span></div><div style=3D"color: rgb(69, 69,
69); text=
-decoration: -webkit-letterpress;"><span style=3D"background-color:
rgba(255=
, 255, 255, 0);">The host is created and is put in maintenance
state.</span>=
</div><div style=3D"color: rgb(69, 69, 69); text-decoration:
-webkit-letterp=
ress;"><span style=3D"background-color: rgba(255, 255, 255,
0);">So far it w=
orks, but then i try to create the networks on the new host and there i got a=
n error.</span><div><blockquote type=3D"cite"><div
class=3D"WordSection1" st=
yle=3D"page: WordSection1;"><p class=3D"MsoNormal"
style=3D"margin: 0cm 0cm 0=
.0001pt;"><span lang=3D"EN-US" style=3D"background-color:
rgba(255, 255, 255=
, 0);"> </span></p><p class=3D"MsoNormal"
style=3D"margin: 0cm 0cm 0.00=
01pt;"><span lang=3D"EN-US" style=3D"background-color: rgba(255,
255, 255, 0=
);">Creating the host:<o:p></o:p></span></p><p
class=3D"MsoNormal" style=3D"=
margin: 0cm 0cm 0.0001pt;"><span lang=3D"EN-US"
style=3D"background-color: r=
gba(255, 255, 255, 0);"> </span></p><p
class=3D"MsoNormal" style=3D"mar=
gin: 0cm 0cm 0.0001pt;"><span lang=3D"EN-US"
style=3D"background-color: rgba=
(255, 255, 255, 0);">
try:<o:p></o:p></span></p><p class=3D=
"MsoNormal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"EN-US" style=3D=
"background-color: rgba(255, 255, 255,
0);"> &n=
bsp; if api.hosts.add(pHst):<o:p></o:p></span></p><p
class=3D"MsoNorma=
l" style=3D"margin: 0cm 0cm 0.0001pt;"><span lang=3D"EN-US"
style=3D"backgro=
und-color: rgba(255, 255, 255,
0);"> &nbs=
p; print("Host was added
successfully")<o:p></o:p></=
span></p><p class=3D"MsoNormal" style=3D"margin: 0cm 0cm
0.0001pt;"><span la=
ng=3D"EN-US" style=3D"background-color: rgba(255, 255, 255,
0);">  =
;
print("Waiting for h=
ost, {}, to reach the 'up' or 'non operational'
status").format(host)<o:p></=
o:p></span></p><p class=3D"MsoNormal" style=3D"margin:
0cm 0cm 0.0001pt;"><s=
pan lang=3D"EN-US" style=3D"background-color: rgba(255, 255, 255,
0);"> =
;
while api.host=
s.get(name =3D host).status.state !=3D 'up' and api.hosts.get(name =3D host)=
.status.state !=3D
'non_operational':<o:p></o:p></span></p><p
class=3D"MsoNo=
rmal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"EN-US" style=3D"back=
ground-color: rgba(255, 255, 255,
0);"> &=
nbsp;
sleep(1)<o:p></o:p></s=
pan></p><p class=3D"MsoNormal" style=3D"margin: 0cm 0cm
0.0001pt;"><span lan=
g=3D"EN-US" style=3D"background-color: rgba(255, 255, 255,
0);"> =
sleep(5)<o:p></o:p></=
span></p><p class=3D"MsoNormal" style=3D"margin: 0cm 0cm
0.0001pt;"><span la=
ng=3D"EN-US" style=3D"background-color: rgba(255, 255, 255,
0);">  =
;
print("Host, {}, is '=
{}'").format(host)<o:p></o:p></span></p><p
class=3D"MsoNormal" style=3D"marg=
in: 0cm 0cm 0.0001pt;"><span lang=3D"EN-US"
style=3D"background-color: rgba(=
255, 255, 255, 0);"> </span></p><p
class=3D"MsoNormal" style=3D"margin:=
0cm 0cm 0.0001pt;"><span lang=3D"EN-US"
style=3D"background-color: rgba(255=
, 255, 255, 0);"> except Exception as
e:<o:p></o:p></span>=
</p><p class=3D"MsoNormal" style=3D"margin: 0cm 0cm
0.0001pt;"><span lang=3D=
"EN-US" style=3D"background-color: rgba(255, 255, 255,
0);"> &nbs=
p; print("Failed to install Host:
{}").format(str(e)=
)<o:p></o:p></span></p><p class=3D"MsoNormal"
style=3D"margin: 0cm 0cm 0.000=
1pt;"><span lang=3D"EN-US" style=3D"background-color: rgba(255,
255, 255, 0)=
;"> return
None<o:p></o:p></span><=
/p><p class=3D"MsoNormal" style=3D"margin: 0cm 0cm
0.0001pt;"><span lang=3D"=
EN-US" style=3D"background-color: rgba(255, 255, 255,
0);"> </span></p>=
<p class=3D"MsoNormal" style=3D"margin: 0cm 0cm
0.0001pt;"><span lang=3D"EN-=
US" style=3D"background-color: rgba(255, 255, 255,
0);"> H=
ost =3D api.hosts.get(name =3D host)<o:p></o:p></span></p><p
class=3D"MsoNor=
mal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"EN-US" style=3D"backg=
round-color: rgba(255, 255, 255, 0);"> </span></p><p
class=3D"MsoNormal=
" style=3D"margin: 0cm 0cm 0.0001pt;"><span lang=3D"EN-US"
style=3D"backgrou=
nd-color: rgba(255, 255, 255, 0);">
Host.deactivate()<o:p>=
</o:p></span></p><p class=3D"MsoNormal"
style=3D"margin: 0cm 0cm 0.0001pt;">=
<span lang=3D"EN-US" style=3D"background-color: rgba(255, 255, 255,
0);">&nb=
sp; sleep(5)<o:p></o:p></span></p><p
class=3D"MsoNormal" style=3D=
"margin: 0cm 0cm 0.0001pt;"><span lang=3D"EN-US"
style=3D"background-color: r=
gba(255, 255, 255, 0);"> address, netmask =3D
getDefaultAd=
dress(api, oc, DC, host)<o:p></o:p></span></p><p
class=3D"MsoNormal" style=3D=
"margin: 0cm 0cm 0.0001pt;"><span lang=3D"EN-US"
style=3D"background-color: r=
gba(255, 255, 255, 0);"> if address is not
None:</span></p=
</div></blockquote><span
style=3D"background-color: rgba(255, 255, 255, 0);=
"><br></span><blockquote type=3D"cite"><div
class=3D"WordSection1" style=3D"=
page: WordSection1;"><p class=3D"MsoNormal" style=3D"margin: 0cm
0cm 0.0001p=
t;"><span style=3D"background-color: rgba(255, 255, 255, 0);">So
far all's w=
ell.</span></p></div></blockquote><blockquote
type=3D"cite"><div class=3D"Wo=
rdSection1" style=3D"page: WordSection1;"><p
class=3D"MsoNormal" style=3D"ma=
rgin: 0cm 0cm 0.0001pt;"><span lang=3D"EN-US"
style=3D"background-color: rgb=
a(255, 255, 255, 0);">Then the part for the
network...<o:p></o:p></span></p>=
<p class=3D"MsoNormal" style=3D"margin: 0cm 0cm
0.0001pt;"><span lang=3D"EN-=
US" style=3D"background-color: rgba(255, 255, 255,
0);"> </span></p><p c=
lass=3D"MsoNormal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"EN-US" s=
tyle=3D"background-color: rgba(255, 255, 255,
0);"> &=
nbsp; rc =3D setBondAndDefVLan(api, oc, DC, cluster, host, addre=
ss, netmask)<o:p></o:p></span></p><p
class=3D"MsoNormal" style=3D"margin: 0c=
m 0cm 0.0001pt;"><span lang=3D"EN-US" style=3D"background-color:
rgba(255, 2=
55, 255,
0);"> if rc
is not None:<=
o:p></o:p></span></p><p class=3D"MsoNormal"
style=3D"margin: 0cm 0cm 0.0001p=
t;"><span lang=3D"EN-US" style=3D"background-color: rgba(255,
255, 255, 0);"=
Host.upd=
ate()<o:p></o:p></span></p><p
class=3D"MsoNormal" style=3D"margin: 0cm 0cm 0=
.0001pt;"><span lang=3D"EN-US" style=3D"background-color:
rgba(255, 255, 255=
,
0);">
Ho=
st.activate()<o:p></o:p></span></p><p
class=3D"MsoNormal" style=3D"margin: 0=
cm 0cm 0.0001pt;"><span lang=3D"EN-US"
style=3D"background-color: rgba(255, 2=
55, 255, 0);"> </span></p><p class=3D"MsoNormal"
style=3D"margin: 0cm 0=
cm 0.0001pt;"><span lang=3D"EN-US" style=3D"background-color:
rgba(255, 255,=
255, 0);">---<o:p></o:p></span></p><p
class=3D"MsoNormal" style=3D"margin: 0=
cm 0cm 0.0001pt;"><span lang=3D"EN-US"
style=3D"background-color: rgba(255, 2=
55, 255, 0);"> </span></p><p class=3D"MsoNormal"
style=3D"margin: 0cm 0=
cm 0.0001pt;"><span lang=3D"EN-US" style=3D"background-color:
rgba(255, 255,=
255, 0);">def setBondParams(api, oc, DC,
host):<o:p></o:p></span></p><p cla=
ss=3D"MsoNormal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"EN-US" st=
yle=3D"background-color: rgba(255, 255, 255,
0);"> nic0 =3D=
params.HostNIC(name
=3D=
oc.nic1,<o:p></o:p></span></p><p class=3D"MsoNormal"
style=3D"margin: 0cm 0=
cm 0.0001pt;"><span lang=3D"EN-US" style=3D"background-color:
rgba(255, 255,=
255, 0);">
&nbs=
p; &n=
bsp; network =3D
params.Network(),<=
o:p></o:p></span></p><p class=3D"MsoNormal"
style=3D"margin: 0cm 0cm 0.0001p=
t;"><span lang=3D"EN-US" style=3D"background-color: rgba(255,
255, 255, 0);"=
&nb=
sp;
b=
oot_protocol =3D 'none',<o:p></o:p></span></p><p
class=3D"MsoNormal" style=3D=
"margin: 0cm 0cm 0.0001pt;"><span lang=3D"EN-US"
style=3D"background-color: r=
gba(255, 255, 255,
0);"> &nbs=
p; &n=
bsp;
ip &nb=
sp; =3D params.IP(<o:p></o:p></span></p><p
class=3D"MsoNormal" s=
tyle=3D"margin: 0cm 0cm 0.0001pt;"><span lang=3D"EN-US"
style=3D"background-=
color: rgba(255, 255, 255,
0);"> &n=
bsp; =
&nbs=
p; &n=
bsp; address =3D
'',<o:p></o:p></span></p><p c=
lass=3D"MsoNormal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"EN-US" s=
tyle=3D"background-color: rgba(255, 255, 255,
0);"> &=
nbsp;  =
;
&n=
bsp; =
netmask
=3D '',<o:p></=
o:p></span></p><p class=3D"MsoNormal" style=3D"margin:
0cm 0cm 0.0001pt;"><s=
pan lang=3D"EN-US" style=3D"background-color: rgba(255, 255, 255,
0);"> =
; &nb=
sp; &=
nbsp;  =
;
ga=
teway =3D '',<o:p></o:p></span></p><p
class=3D"MsoNormal" style=3D"margin: 0=
cm 0cm 0.0001pt;"><span lang=3D"EN-US"
style=3D"background-color: rgba(255, 2=
55, 255,
0);"> &n=
bsp; =
&nbs=
p; &n=
bsp; ),<o:p></o:p></span></p><p
class=3D"MsoNormal" style=3D"margin: 0=
cm 0cm 0.0001pt;"><span lang=3D"EN-US"
style=3D"background-color: rgba(255, 2=
55, 255,
0);"> &n=
bsp; =
)<o:p></o:p></span></p><p
class=3D"MsoNormal" style=3D"margin: 0cm 0c=
m 0.0001pt;"><span lang=3D"EN-US" style=3D"background-color:
rgba(255, 255, 2=
55, 0);"> nic1 =3D
params.HostNIC(name &n=
bsp; =3D
oc.nic2,<o:p></o:p></span></p><p clas=
s=3D"MsoNormal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"EN-US" sty=
le=3D"background-color: rgba(255, 255, 255,
0);"> &nb=
sp; &=
nbsp;
network &nb=
sp; =3D
params.Network(),<o:p></o:p></span></p><p class=3D"MsoNo=
rmal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"EN-US" style=3D"back=
ground-color: rgba(255, 255, 255,
0);"> &=
nbsp;  =
; boot_protocol =3D
'none',<o:p></o:p></=
span></p><p class=3D"MsoNormal" style=3D"margin: 0cm 0cm
0.0001pt;"><span la=
ng=3D"EN-US" style=3D"background-color: rgba(255, 255, 255,
0);">  =
; &nb=
sp;
ip &nbs=
p;
=3D params.IP(<o:p>=
</o:p></span></p><p class=3D"MsoNormal"
style=3D"margin: 0cm 0cm 0.0001pt;">=
<span lang=3D"EN-US" style=3D"background-color: rgba(255, 255, 255,
0);">&nb=
sp; &=
nbsp;  =
; &nb=
sp;
a=
ddress =3D '',<o:p></o:p></span></p><p
class=3D"MsoNormal" style=3D"margin: 0=
cm 0cm 0.0001pt;"><span lang=3D"EN-US"
style=3D"background-color: rgba(255, 2=
55, 255,
0);"> &n=
bsp; =
&nbs=
p; &n=
bsp; netmask =3D
'',<o:p></o:p></span></p><p
class=3D"MsoNormal"=
style=3D"margin: 0cm 0cm 0.0001pt;"><span lang=3D"EN-US"
style=3D"backgroun=
d-color: rgba(255, 255, 255,
0);"> =
&nbs=
p; &n=
bsp; =
gateway =3D
'',<o:p></o:p></span></p><p=
class=3D"MsoNormal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"EN-US=
" style=3D"background-color: rgba(255, 255, 255,
0);"> &nbs=
p; &n=
bsp; =
&nbs=
p;
),<o:p></o:p></span></p><=
p class=3D"MsoNormal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"EN-U=
S" style=3D"background-color: rgba(255, 255, 255,
0);"> &nb=
sp; &=
nbsp;
)<o:p></o:p></span></p><p cl=
ass=3D"MsoNormal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"EN-US" s=
tyle=3D"background-color: rgba(255, 255, 255,
0);"> <=
o:p></o:p></span></p><p class=3D"MsoNormal"
style=3D"margin: 0cm 0cm 0.0001p=
t;"><span lang=3D"EN-US" style=3D"background-color: rgba(255,
255, 255, 0);"=
bond =3D
params.Bonding(slaves =3D params.Sla=
ves(host_nic =3D
[<o:p></o:p></span></p><p class=3D"MsoNormal"
style=3D"marg=
in: 0cm 0cm 0.0001pt;"><span lang=3D"EN-US"
style=3D"background-color: rgba(=
255, 255, 255,
0);"> &n=
bsp; =
&nbs=
p; &n=
bsp; =
nic0,<o:p></o:p></span></p><p
class=3D"MsoNormal" style=3D"margin: 0c=
m 0cm 0.0001pt;"><span lang=3D"EN-US" style=3D"background-color:
rgba(255, 2=
55, 255,
0);"> &n=
bsp; =
&nbs=
p; &n=
bsp; =
nic1,<o:p></o:p></span></p><p class=3D"MsoNormal"
style=3D"margin: 0cm 0cm 0=
.0001pt;"><span lang=3D"EN-US" style=3D"background-color:
rgba(255, 255, 255=
,
0);"> &nb=
sp; &=
nbsp;  =
; &nb=
sp;
]),<o:p></o:=
p></span></p><p class=3D"MsoNormal" style=3D"margin: 0cm
0cm 0.0001pt;"><spa=
n lang=3D"EN-US" style=3D"background-color: rgba(255, 255, 255,
0);"> &=
nbsp;  =
;
options =3D=
params.Options(option =3D [<o:p></o:p></span></p><p
class=3D"MsoNormal" sty=
le=3D"margin: 0cm 0cm 0.0001pt;"><span lang=3D"EN-US"
style=3D"background-co=
lor: rgba(255, 255, 255,
0);"> &nbs=
p; &n=
bsp; =
&nbs=
p; &n=
bsp; params.Option(name =3D
'miimon',<o:p></o:p></span></p><p cl=
ass=3D"MsoNormal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"EN-US" s=
tyle=3D"background-color: rgba(255, 255, 255,
0);"> &=
nbsp;  =
; &nb=
sp; &=
nbsp;  =
;
&n=
bsp; value =3D
'100'),<o:p></o:p></span><=
/p><p class=3D"MsoNormal" style=3D"margin: 0cm 0cm
0.0001pt;"><span lang=3D"=
EN-US" style=3D"background-color: rgba(255, 255, 255,
0);">  =
; &nb=
sp; &=
nbsp;
&nbs=
p; &n=
bsp; params.Option(name
=3D 'mode',=
<o:p></o:p></span></p><p class=3D"MsoNormal"
style=3D"margin: 0cm 0cm 0.0001=
pt;"><span lang=3D"EN-US" style=3D"background-color: rgba(255,
255, 255, 0);=
"> &n=
bsp; =
&nbs=
p; &n=
bsp; =
value
=3D=
'4'),<o:p></o:p></span></p><p
class=3D"MsoNormal" style=3D"margin: 0cm 0cm 0=
.0001pt;"><span lang=3D"EN-US" style=3D"background-color:
rgba(255, 255, 255=
,
0);"> &nb=
sp; &=
nbsp;  =
; &nb=
sp;
])<o:p></o:p></spa=
n></p><p class=3D"MsoNormal" style=3D"margin: 0cm 0cm
0.0001pt;"><span lang=3D=
"EN-US" style=3D"background-color: rgba(255, 255, 255,
0);"> &nbs=
p; &n=
bsp;
)<o:p></o:p></span></p>=
<p class=3D"MsoNormal" style=3D"margin: 0cm 0cm
0.0001pt;"><span lang=3D"EN-=
US" style=3D"background-color: rgba(255, 255, 255,
0);"> </span></p><p c=
lass=3D"MsoNormal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"EN-US" s=
tyle=3D"background-color: rgba(255, 255, 255,
0);"> team =3D=
params.HostNIC(name &n=
bsp; =3D
'bond0',<o:p></o:p>=
</span></p><p class=3D"MsoNormal" style=3D"margin: 0cm 0cm
0.0001pt;"><span l=
ang=3D"EN-US" style=3D"background-color: rgba(255, 255, 255,
0);"> &nbs=
p; &n=
bsp;
boot_protoc=
ol
=3D 'none',<o:p></o=
:p></span></p><p class=3D"MsoNormal" style=3D"margin: 0cm
0cm 0.0001pt;"><sp=
an lang=3D"EN-US" style=3D"background-color: rgba(255, 255, 255,
0);"> =
&nbs=
p;
ip =
; &nb=
sp; =3D
params.IP(<o:p></o:p></span></p>=
<p class=3D"MsoNormal" style=3D"margin: 0cm 0cm
0.0001pt;"><span lang=3D"EN-=
US" style=3D"background-color: rgba(255, 255, 255,
0);"> &n=
bsp; =
&nbs=
p; &n=
bsp; =
address =3D
'',<o:p></o:p></span></p><p=
class=3D"MsoNormal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"EN-US=
" style=3D"background-color: rgba(255, 255, 255,
0);"> &nbs=
p; &n=
bsp;
 =
; &nb=
sp; &=
nbsp; netmask =3D
'',<o:p></o:p></span></p><p c=
lass=3D"MsoNormal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"EN-US" s=
tyle=3D"background-color: rgba(255, 255, 255,
0);"> &=
nbsp;  =
; &nb=
sp; &=
nbsp;  =
; gateway =3D
'',<o:p></o:p></span></p><p clas=
s=3D"MsoNormal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"EN-US" sty=
le=3D"background-color: rgba(255, 255, 255,
0);"> &nb=
sp; &=
nbsp;  =
; &nb=
sp; &=
nbsp; ),<o:p></o:p></span></p><p
class=3D"MsoNormal" style=
=3D"margin: 0cm 0cm 0.0001pt;"><span lang=3D"EN-US"
style=3D"background-colo=
r: rgba(255, 255, 255,
0);"> =
&nbs=
p; override_configuration =3D
1,<o:p></o:p></span></=
p><p class=3D"MsoNormal" style=3D"margin: 0cm 0cm
0.0001pt;"><span lang=3D"E=
N-US" style=3D"background-color: rgba(255, 255, 255,
0);"> =
&nb=
sp; bonding =
&nbs=
p; =3D bond)<o:p></o:p></span></p><p
class=3D"MsoNormal" style=3D"margin: 0c=
m 0cm 0.0001pt;"><span lang=3D"EN-US" style=3D"background-color:
rgba(255, 2=
55, 255, 0);"> return
team<o:p></o:p></span></p><p class=3D=
"MsoNormal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"EN-US" style=3D=
"background-color: rgba(255, 255, 255,
0);"> </span></p><p class=3D"Mso=
Normal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"EN-US" style=3D"ba=
ckground-color: rgba(255, 255, 255, 0);"> </span></p><p
class=3D"MsoNor=
mal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"EN-US" style=3D"backg=
round-color: rgba(255, 255, 255, 0);">def setDefVLanParams(api, oc, DC, clus=
ter, host, address, netmask):<o:p></o:p></span></p><p
class=3D"MsoNormal" st=
yle=3D"margin: 0cm 0cm 0.0001pt;"><span lang=3D"EN-US"
style=3D"background-c=
olor: rgba(255, 255, 255, 0);"> defvlan =3D
oc.defaultvlan=
<o:p></o:p></span></p><p class=3D"MsoNormal"
style=3D"margin: 0cm 0cm 0.0001=
pt;"><span lang=3D"EN-US" style=3D"background-color: rgba(255,
255, 255, 0);=
"> clusterNW =3D
api.clusters.get(cluster).networks.get(na=
me =3D defvlan)<o:p></o:p></span></p><p
class=3D"MsoNormal" style=3D"margin:=
0cm 0cm 0.0001pt;"><span lang=3D"EN-US"
style=3D"background-color: rgba(255=
, 255, 255, 0);"> vlan =3D
params.HostNIC(name =
&nbs=
p; =3D
"bond0.{}".format(clusterNW.vlan.id),<o:p></o:p></s=
pan></p><p class=3D"MsoNormal" style=3D"margin: 0cm 0cm
0.0001pt;"><span lan=
g=3D"EN-US" style=3D"background-color: rgba(255, 255, 255,
0);"> =
&nbs=
p;
network =
&nbs=
p; =3D params.Network(name =3D
defvlan),<o:p></o:p></span></p><p class=
=3D"MsoNormal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"EN-US" styl=
e=3D"background-color: rgba(255, 255, 255,
0);"> &nbs=
p; &n=
bsp;
boot_protocol &nbs=
p; =3D
'none',<o:p></o:p></span></p><p c=
lass=3D"MsoNormal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"EN-US" s=
tyle=3D"background-color: rgba(255, 255, 255,
0);"> &=
nbsp;  =
;
ip =
&nbs=
p; =3D
params.IP(<o:p></o:p></span></p><p class=3D"MsoNorm=
al" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"EN-US" style=3D"backgr=
ound-color: rgba(255, 255, 255,
0);"> &nb=
sp; &=
nbsp;  =
; &nb=
sp; &=
nbsp; address =3D
address,<o:p></o:p></span></p><p class=3D"MsoN=
ormal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"EN-US" style=3D"bac=
kground-color: rgba(255, 255, 255,
0);"> =
&nbs=
p; &n=
bsp; =
&nbs=
p; netmask =3D
netmask,<o:p></o:p></span></p><p class=3D"M=
soNormal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"EN-US" style=3D"=
background-color: rgba(255, 255, 255,
0);"> &nb=
sp; &=
nbsp;
&nbs=
p; &n=
bsp; =
gateway =3D
''<o:p></o:p></span></p><p class=3D"MsoN=
ormal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"EN-US" style=3D"bac=
kground-color: rgba(255, 255, 255,
0);"> =
&nbs=
p; &n=
bsp; =
&nbs=
p; ),<o:p></o:p></span></p><p
class=3D"MsoNormal" style=3D"margi=
n: 0cm 0cm 0.0001pt;"><span lang=3D"EN-US"
style=3D"background-color: rgba(2=
55, 255, 255,
0);"> &nb=
sp; &=
nbsp; override_configuration =3D
1,<o:p></o:p></span></p><p clas=
s=3D"MsoNormal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"EN-US" sty=
le=3D"background-color: rgba(255, 255, 255,
0);"> &nb=
sp; &=
nbsp;
)<o:p></o:p></span></p><p class=3D=
"MsoNormal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"EN-US" style=3D=
"background-color: rgba(255, 255, 255, 0);">
return vlan<o=
:p></o:p></span></p><p class=3D"MsoNormal"
style=3D"margin: 0cm 0cm 0.0001pt=
;"><span lang=3D"EN-US" style=3D"background-color: rgba(255,
255, 255, 0);">=
</span></p><p class=3D"MsoNormal" style=3D"margin:
0cm 0cm 0.0001pt;">=
<span lang=3D"EN-US" style=3D"background-color: rgba(255, 255, 255,
0);">&nb=
sp;</span></p><p class=3D"MsoNormal" style=3D"margin: 0cm
0cm 0.0001pt;"><sp=
an lang=3D"EN-US" style=3D"background-color: rgba(255, 255, 255,
0);">def se=
tBondAndDefVLan(api, oc, DC, cluster, host, address,
netmask):<o:p></o:p></s=
pan></p><p class=3D"MsoNormal" style=3D"margin: 0cm 0cm
0.0001pt;"><span lan=
g=3D"EN-US" style=3D"background-color: rgba(255, 255, 255,
0);"> =
try:<o:p></o:p></span></p><p
class=3D"MsoNormal" style=3D"margin: 0cm=
0cm 0.0001pt;"><span lang=3D"EN-US" style=3D"background-color:
rgba(255, 25=
5, 255,
0);"> Host
=3D api.hosts.g=
et(name =3D host)<o:p></o:p></span></p><p
class=3D"MsoNormal" style=3D"margi=
n: 0cm 0cm 0.0001pt;"><span lang=3D"EN-US"
style=3D"background-color: rgba(2=
55, 255, 255, 0);"> except Exception as
e:<o:p></o:p></spa=
n></p><p class=3D"MsoNormal" style=3D"margin: 0cm 0cm
0.0001pt;"><span lang=3D=
"EN-US" style=3D"background-color: rgba(255, 255, 255,
0);"> &nbs=
p; print("Could not find host {}, this is
extremly w=
rong!\n{}").format(host, str(e))<o:p></o:p></span></p><p
class=3D"MsoNormal"=
style=3D"margin: 0cm 0cm 0.0001pt;"><span lang=3D"EN-US"
style=3D"backgroun=
d-color: rgba(255, 255, 255,
0);"> =
return None<o:p></o:p></span></p><p
class=3D"MsoNormal" style=3D"margin: 0c=
m 0cm 0.0001pt;"><span lang=3D"EN-US" style=3D"background-color:
rgba(255, 2=
55, 255, 0);"> </span></p><p class=3D"MsoNormal"
style=3D"margin: 0cm 0=
cm 0.0001pt;"><span lang=3D"EN-US" style=3D"background-color:
rgba(255, 255,=
255, 0);"> team =3D setBondParams(api, oc, DC,
Host)<o:p>=
</o:p></span></p><p class=3D"MsoNormal"
style=3D"margin: 0cm 0cm 0.0001pt;">=
<span lang=3D"EN-US" style=3D"background-color: rgba(255, 255, 255,
0);">&nb=
sp; vlan =3D setDefVLan(api, oc, DC, cluster, Host, address, net=
mask)<o:p></o:p></span></p><p class=3D"MsoNormal"
style=3D"margin: 0cm 0cm 0=
.0001pt;"><span lang=3D"EN-US" style=3D"background-color:
rgba(255, 255, 255=
, 0);"> </span></p><p class=3D"MsoNormal"
style=3D"margin: 0cm 0cm 0.00=
01pt;"><span lang=3D"EN-US" style=3D"background-color: rgba(255,
255, 255, 0=
);">
try:<o:p></o:p></span></p><p class=3D"MsoNormal"
styl=
e=3D"margin: 0cm 0cm 0.0001pt;"><span lang=3D"EN-US"
style=3D"background-col=
or: rgba(255, 255, 255,
0);"> Host=
.nics.setupnetworks(params.Action(force =3D
0,<o:p></o:p></span></p><p class=
=3D"MsoNormal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"EN-US" styl=
e=3D"background-color: rgba(255, 255, 255,
0);"> &nbs=
p; &n=
bsp; =
&nbs=
p; check_connectivity =3D
0,<o:p></o:p></span></p><p class=3D"Ms=
oNormal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"EN-US" style=3D"b=
ackground-color: rgba(255, 255, 255,
0);"> &nbs=
p; &n=
bsp; =
&nbs=
p; host_nics =3D params.HostNics(host_nic =3D
[<o:p></o:p></span></p><=
p class=3D"MsoNormal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
style=3D"bac=
kground-color: rgba(255, 255, 255, 0);"><span
lang=3D"EN-US"> &nb=
sp; &=
nbsp;  =
; &nb=
sp; &=
nbsp;  =
; &nb=
sp; </span>team, <o:p></o:p></=
span></p><p class=3D"MsoNormal" style=3D"margin: 0cm 0cm
0.0001pt;"><span st=
yle=3D"background-color: rgba(255, 255, 255,
0);"> &n=
bsp; =
&nbs=
p; &n=
bsp; =
&nbs=
p; &n=
bsp; vlan,<o:p></o:p></span></p><p
class=3D"Mso=
Normal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
style=3D"background-color:=
rgba(255, 255, 255,
0);"> &n=
bsp; =
&nbs=
p; &n=
bsp; =
&nbs=
p; &n=
bsp;])<o:p></o:p></span></p><p class=3D"MsoNormal"
style=3D"margin: 0cm 0cm 0=
.0001pt;"><span style=3D"background-color: rgba(255, 255, 255,
0);"> &n=
bsp; =
&nbs=
p; &n=
bsp;
),<o:p></o:p></span></p><p class=3D"MsoNormal" s=
tyle=3D"margin: 0cm 0cm 0.0001pt;"><span style=3D"background-color:
rgba(255=
, 255, 255,
0);">  =
; &nb=
sp;
)<o:p></o:p></span></p><p clas=
s=3D"MsoNormal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"EN-US" sty=
le=3D"background-color: rgba(255, 255, 255,
0);"> except E=
xception as e:<o:p></o:p></span></p><p
class=3D"MsoNormal" style=3D"margin: 0=
cm 0cm 0.0001pt;"><span lang=3D"EN-US"
style=3D"background-color: rgba(255, 2=
55, 255,
0);">
print("Could not se=
tup a management interface for host {}.\n--\n{}\n--").format(host, str(e))<o=
:p></o:p></span></p><p class=3D"MsoNormal"
style=3D"margin: 0cm 0cm 0.0001pt=
;"><span lang=3D"EN-US" style=3D"background-color: rgba(255,
255, 255, 0);">=
return
None<o:p></o:p></span></p>=
<p class=3D"MsoNormal" style=3D"margin: 0cm 0cm
0.0001pt;"><span lang=3D"EN-=
US" style=3D"background-color: rgba(255, 255, 255,
0);"> </span></p><p c=
lass=3D"MsoNormal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"EN-US" s=
tyle=3D"background-color: rgba(255, 255, 255,
0);"> return=
host<o:p></o:p></span></p><p class=3D"MsoNormal"
style=3D"margin: 0cm 0cm 0=
.0001pt;"><span lang=3D"EN-US" style=3D"background-color:
rgba(255, 255, 255=
, 0);"> </span></p><p class=3D"MsoNormal"
style=3D"margin: 0cm 0cm 0.00=
01pt;"><span lang=3D"EN-US" style=3D"background-color: rgba(255,
255, 255, 0=
);"> </span></p><p class=3D"MsoNormal"
style=3D"margin: 0cm 0cm 0.0001p=
t;"><span lang=3D"EN-US" style=3D"background-color: rgba(255,
255, 255, 0);"=
The setting for oc.nic1 is 'eno1' and oc.nic2 is
'eno2'.<o:p></o:p></span><=
/p><p
class=3D"MsoNormal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"=
EN-US" style=3D"background-color: rgba(255, 255, 255, 0);">This part of
the s=
cript times out on "Host.nics.setupnetworks(...)
with:<o:p></o:p></span></p>=
<p class=3D"MsoNormal" style=3D"margin: 0cm 0cm
0.0001pt;"><span lang=3D"EN-=
US" style=3D"background-color: rgba(255, 255, 255,
0);"> </span></p><p c=
lass=3D"MsoNormal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"EN-US" s=
tyle=3D"background-color: rgba(255, 255, 255, 0);">"Host was added
successfu=
lly"<o:p></o:p></span></p><p class=3D"MsoNormal"
style=3D"margin: 0cm 0cm 0.=
0001pt;"><span lang=3D"EN-US" style=3D"background-color:
rgba(255, 255, 255,=
0);">"Waiting for host, X, to reach the 'up' or 'non
operational' status"<o=
:p></o:p></span></p><p class=3D"MsoNormal"
style=3D"margin: 0cm 0cm 0.0001pt=
;"><span lang=3D"EN-US" style=3D"background-color: rgba(255,
255, 255, 0);">=
"Host, X, is
'non_operational'"<o:p></o:p></span></p><p
class=3D"MsoNormal" s=
tyle=3D"margin: 0cm 0cm 0.0001pt;"><span lang=3D"EN-US"
style=3D"background-=
color: rgba(255, 255, 255, 0);"> </span></p><p
class=3D"MsoNormal" styl=
e=3D"margin: 0cm 0cm 0.0001pt;"><span lang=3D"EN-US"
style=3D"background-col=
or: rgba(255, 255, 255, 0);">"Could not setup a management interface for
hos=
t X."<o:p></o:p></span></p><p
class=3D"MsoNormal" style=3D"margin: 0cm 0cm 0=
.0001pt;"><span lang=3D"EN-US" style=3D"background-color:
rgba(255, 255, 255=
, 0);">"--"<o:p></o:p></span></p><p
class=3D"MsoNormal" style=3D"margin: 0cm=
0cm 0.0001pt;"><span lang=3D"EN-US" style=3D"background-color:
rgba(255, 25=
5, 255, 0);"> </span></p><p class=3D"MsoNormal"
style=3D"margin: 0cm 0c=
m 0.0001pt;"><span lang=3D"EN-US" style=3D"background-color:
rgba(255, 255, 2=
55, 0);">"status:
400"<o:p></o:p></span></p><p class=3D"MsoNormal"
style=3D"=
margin: 0cm 0cm 0.0001pt;"><span lang=3D"EN-US"
style=3D"background-color: r=
gba(255, 255, 255, 0);">"reason: Bad
Request"<o:p></o:p></span></p><p class=3D=
"MsoNormal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"EN-US" style=3D=
"background-color: rgba(255, 255, 255, 0);">"detail: Network error
during co=
mmunication with the Host."<o:p></o:p></span></p><p
class=3D"MsoNormal" styl=
e=3D"margin: 0cm 0cm 0.0001pt;"><span lang=3D"EN-US"
style=3D"background-col=
or: rgba(255, 255, 255,
0);">"--"<o:p></o:p></span></p><p
class=3D"MsoNormal=
" style=3D"margin: 0cm 0cm 0.0001pt;"><span lang=3D"EN-US"
style=3D"backgrou=
nd-color: rgba(255, 255, 255, 0);"> </span></p><p
class=3D"MsoNormal" s=
tyle=3D"margin: 0cm 0cm 0.0001pt;"><span lang=3D"EN-US"
style=3D"background-=
color: rgba(255, 255, 255, 0);">The problem with the communication is that o=
n the new host X all the ip configuration is
gone.<o:p></o:p></span></p><p c=
lass=3D"MsoNormal" style=3D"margin: 0cm 0cm 0.0001pt;"><span
lang=3D"EN-US" s=
tyle=3D"background-color: rgba(255, 255, 255, 0);">The question i have is
"W=
hy is the ip configuration gone?"<o:p></o:p></span></p><p
class=3D"MsoNormal=
" style=3D"margin: 0cm 0cm 0.0001pt;"><span lang=3D"EN-US"
style=3D"backgrou=
nd-color: rgba(255, 255, 255, 0);">What am i donig wrong
here?</span></p></d=
iv></blockquote><br><blockquote type=3D"cite"><div
class=3D"WordSection1" st=
yle=3D"page: WordSection1;"><p class=3D"MsoNormal"
style=3D"margin: 0cm 0cm 0=
.0001pt;"><span style=3D"background-color: rgba(255, 255, 255, 0); color:
rg=
b(69, 69,
69);">->Rein.</span></p></div></blockquote></div></div><div>(va=
naf BigI)</div></div></body></html>=
--Apple-Mail-89C7D827-97B3-48B9-BD94-15A1C42B97DB--