--Apple-Mail=_62AEA0E7-D58F-45F5-A309-BE84C8F41136
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=us-ascii
To try to learn the python SDK, and help the automation of my setup, I =
wrote a CLI to oVirt.
It tries to hide some of the complexity, so some simple python script =
like :
dc =3D context.datacenter(name=3D"dc1")
if dc is not None:
dc.delete(force=3DTrue)
context.datacenter().create(name=3D"dc1", local=3DFalse, =
storage_format=3D"v3", mac_pool_name=3D"MoreMac")
cluster =3D context.cluster(name=3D"cl1")
if cluster is not None:
cluster.delete(force=3DTrue)
context.cluster().create(name=3D"cl1", cpu_type=3D"Intel Haswell-noTSX =
Family", dc_name=3D"en02",
memory_policy=3D{'guaranteed': True, =
'overcommit': 100, 'transparent_hugepages': False},
ballooning_enabled=3DTrue)
can be used. It avoid the use of params.Something.
It can also be used to do action in shell like :
./ovcmd -c ovirt.ini host -n host1 bond -i eth0 -i eth1 -n ovirtmgmt -o =
mode 4 -o miimon 100 -o xmit_hash_policy 2+3 -D -m 9000
or
./ovcmd -c ovirt.ini host -n host1 export nics
Complex commands can take template as an argument :
./ovcmd -d -c ovirt.ini vm create -T vm1.yaml -V cores 2 -V memory 4G -n =
vm1
It's of course on github :
https://github.com/fbacchella/ovirtcmd =
<
https://github.com/fbacchella/ovirtcmd>
It's still a work in progress, only the very basic commands are =
implemented, I will add other as requested, it should be easy to do so.=
--Apple-Mail=_62AEA0E7-D58F-45F5-A309-BE84C8F41136
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
charset=us-ascii
<html><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
-webkit-line-break: after-white-space;" class=3D"">To try to learn the
=
python SDK, and help the automation of my setup, I wrote a CLI to =
oVirt.<br class=3D""><br class=3D"">It tries to hide some
of the =
complexity, so some simple python script like :<br class=3D""><br =
class=3D""><font face=3D"Menlo" class=3D"">dc =3D
=
context.datacenter(name=3D"dc1")<br
class=3D"">if dc is =
not None:<br class=3D"">
dc.delete(force=3DTrue)<br =
class=3D"">context.datacenter().create(name=3D"</font><span =
style=3D"font-family: Menlo;" class=3D"">dc1</span><font
face=3D"Menlo" =
class=3D"">", local=3DFalse, storage_format=3D"v3", mac_poo=
l_name=3D"MoreMac")<br class=3D""><br
class=3D"">cluster =3D =
context.cluster(name=3D"cl1")<br
class=3D"">if cluster is =
not None:<br class=3D"">
cluster.delete(force=3DTrue)<br=
class=3D"">context.cluster().create(name=3D"</font><span =
style=3D"font-family: Menlo;" class=3D"">cl1</span><font
face=3D"Menlo" =
class=3D"">", cpu_type=3D"Intel Haswell-noTSX =
Family", dc_name=3D"en02",<br
class=3D""> =
=
memory_policy=3D{'guaranteed': True, 'overcommit': 10=
0, 'transparent_hugepages': False},<br
class=3D""> =
=
ballooning_enabled=3DTrue)<br
class=3D""></font><br =
class=3D""><div class=3D"">can be used. It avoid the use of
=
params.Something.</div><div class=3D""><br
class=3D""></div><div =
class=3D"">It can also be used to do action in shell like
:</div><div =
class=3D""><br class=3D""></div><div
class=3D""><div style=3D"margin: =
0px; font-family: Menlo;" class=3D"">./ovcmd -c ovirt.ini host -n host1
=
bond -i eth0 -i eth1 -n ovirtmgmt -o mode 4 -o miimon 100 -o =
xmit_hash_policy 2+3 -D -m 9000</div></div><div style=3D"margin:
0px;" =
class=3D""><br class=3D""></div><div
style=3D"margin: 0px;" =
class=3D"">or</div><div style=3D"margin: 0px;"
class=3D""><br =
class=3D""></div><div style=3D"margin: 0px; font-family:
Menlo;" =
class=3D"">./ovcmd -c ovirt.ini host -n host1 export nics</div><div
=
style=3D"margin: 0px; font-family: Menlo;" class=3D""><br =
class=3D""></div><div style=3D"margin: 0px;"
class=3D"">Complex commands =
can take template as an argument :</div><div style=3D"margin: 0px;" =
class=3D""><br class=3D""></div><div
style=3D"margin: 0px;" =
class=3D""><div style=3D"margin: 0px; font-family: Menlo;" =
class=3D"">./ovcmd -d -c ovirt.ini vm create -T vm1.yaml -V
=
cores 2 -V memory 4G -n vm1</div><div style=3D"margin: 0px;" =
class=3D""><br class=3D""></div><div
style=3D"margin: 0px;" =
class=3D"">It's of course on github :</div><div
style=3D"margin: 0px;" =
class=3D""><a
href=3D"https://github.com/fbacchella/ovirtcmd" =
class=3D"">https://github.com/fbacchella/ovirtcmd</a>&...
=
style=3D"margin: 0px;" class=3D""><br
class=3D""></div><div =
style=3D"margin: 0px;" class=3D"">It's still a work in
progress, only =
the very basic commands are implemented, I will add other as requested, =
it should be easy to do so.</div></div></body></html>=
--Apple-Mail=_62AEA0E7-D58F-45F5-A309-BE84C8F41136--