[ovirt-users] Details of the host

ChandraShekar Shastri pm.chandrashekar at gmail.com
Sat Jan 24 14:31:51 UTC 2015


Thanks Juan,

Can I login into the ovirt-engine url using the encrypted password. If it
is possible what are the encryption method that it allows.

Please share the code if you have it handy.

Thanks,
Chandrashekar

On Fri, Jan 23, 2015 at 1:46 PM, Juan Hernández <jhernand at redhat.com> wrote:

> On 01/21/2015 02:27 PM, ChandraShekar Shastri wrote:
> > Hi All,
> >
> > I want to get the details of the Host without activating is there a way
> > to do it.
> > I want to query the RHEV-Manager and would like to get the details of
> > MAC address without activating it.
> >
> > Do you have the script to do this.
> >
> > Thanks,
> > Chandrashekar
> >
>
> Assuming that the host has already been added to the system then you can
> get the details with a Python script like this:
>
> #!/usr/bin/python
>
> from ovirtsdk.api import API
> from ovirtsdk.xml import params
>
> api = API(
>   url='https://ovirt.example.com/ovirt-engine/api',
>   username='admin at internal',
>   password='******',
>   insecure=True
> )
>
> host = api.hosts.get(name="myhost")
> nics = host.nics.list()
> for nic in nics:
>     print("%s: %s" % (nic.get_name(), nic.get_mac().get_address()))
>
> api.disconnect()
>
> This will print something like this:
>
> eth0: 52:54:00:9d:a7:26
>
> If the host hasn't been added you can add it, without activating it:
>
> #!/usr/bin/python
>
> from ovirtsdk.api import API
> from ovirtsdk.xml import params
>
> api = API(
>   url='https://rhevm35.example.com/ovirt-engine/api',
>   username='admin at internal',
>   password='******',
>   insecure=True,
> )
>
> api.hosts.add(
>   host = params.Host(
>     name="myhost",
>     address="myhost.example.com",
>     root_password="******"
>   )
> )
>
> api.disconnect()
>
> --
> Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta
> 3ºD, 28016 Madrid, Spain
> Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941 - Red Hat S.L.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/users/attachments/20150124/cf8c2c96/attachment-0001.html>


More information about the Users mailing list