
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

This is a multipart message in MIME format. ------=_NextPart_000_001A_01D03636.EA8B5C80 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable When you add a host you will be able to see the details, and then you = can place the host in maintenance mode to ensure no VM=E2=80=99s are = brought up on it. =20 But if you just need the mac address, why not ssh into it and get it = from ip addr =20 =20 Donny D =20 From: users-bounces@ovirt.org [mailto:users-bounces@ovirt.org] On Behalf = Of ChandraShekar Shastri Sent: Wednesday, January 21, 2015 6:28 AM To: users@ovirt.org Subject: [ovirt-users] Details of the host =20 Hi All, =20 I want to get the details of the Host without activating is there a way = to do it.=20 I want to query the RHEV-Manager and would like to get the details of = MAC address without activating it.=20 =20 Do you have the script to do this. =20 Thanks, Chandrashekar=20 =20 ------=_NextPart_000_001A_01D03636.EA8B5C80 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <html xmlns:v=3D"urn:schemas-microsoft-com:vml" = xmlns:o=3D"urn:schemas-microsoft-com:office:office" = xmlns:w=3D"urn:schemas-microsoft-com:office:word" = xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" = xmlns=3D"http://www.w3.org/TR/REC-html40"><head><meta = http-equiv=3DContent-Type content=3D"text/html; charset=3Dutf-8"><meta = name=3DGenerator content=3D"Microsoft Word 14 (filtered = medium)"><style><!-- /* Font Definitions */ @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4;} @font-face {font-family:Tahoma; panose-1:2 11 6 4 3 5 4 4 2 4;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0in; margin-bottom:.0001pt; font-size:12.0pt; font-family:"Times New Roman","serif";} a:link, span.MsoHyperlink {mso-style-priority:99; color:blue; text-decoration:underline;} a:visited, span.MsoHyperlinkFollowed {mso-style-priority:99; color:purple; text-decoration:underline;} span.EmailStyle17 {mso-style-type:personal-reply; font-family:"Calibri","sans-serif"; color:#1F497D;} .MsoChpDefault {mso-style-type:export-only; font-family:"Calibri","sans-serif";} @page WordSection1 {size:8.5in 11.0in; margin:1.0in 1.0in 1.0in 1.0in;} div.WordSection1 {page:WordSection1;} --></style><!--[if gte mso 9]><xml> <o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" /> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext=3D"edit"> <o:idmap v:ext=3D"edit" data=3D"1" /> </o:shapelayout></xml><![endif]--></head><body lang=3DEN-US link=3Dblue = vlink=3Dpurple><div class=3DWordSection1><p class=3DMsoNormal><span = style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497= D'>When you add a host you will be able to see the details, and then you = can place the host in maintenance mode to ensure no VM=E2=80=99s are = brought up on it.<o:p></o:p></span></p><p class=3DMsoNormal><span = style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497= D'><o:p> </o:p></span></p><p class=3DMsoNormal><span = style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497= D'>But if you just need the mac address, why not ssh into it and get it = from ip addr<o:p></o:p></span></p><p class=3DMsoNormal><span = style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497= D'><o:p> </o:p></span></p><p class=3DMsoNormal><span = style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497= D'><o:p> </o:p></span></p><p class=3DMsoNormal><span = style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497= D'>Donny D<o:p></o:p></span></p><p class=3DMsoNormal><span = style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497= D'><o:p> </o:p></span></p><p class=3DMsoNormal><b><span = style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span>= </b><span style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'> = users-bounces@ovirt.org [mailto:users-bounces@ovirt.org] <b>On Behalf Of = </b>ChandraShekar Shastri<br><b>Sent:</b> Wednesday, January 21, 2015 = 6:28 AM<br><b>To:</b> users@ovirt.org<br><b>Subject:</b> [ovirt-users] = Details of the host<o:p></o:p></span></p><p = class=3DMsoNormal><o:p> </o:p></p><div><div><div><p = class=3DMsoNormal>Hi All,<o:p></o:p></p><div><p = class=3DMsoNormal><o:p> </o:p></p><div><p class=3DMsoNormal>I want = to get the details of the Host without activating is there a way to do = it. <o:p></o:p></p></div><div><p class=3DMsoNormal>I want to query = the RHEV-Manager and would like to get the details of MAC address = without activating it. <o:p></o:p></p></div><div><p = class=3DMsoNormal><o:p> </o:p></p></div><div><p = class=3DMsoNormal>Do you have the script to do = this.<o:p></o:p></p></div></div><div><p = class=3DMsoNormal><o:p> </o:p></p></div><div><p = class=3DMsoNormal>Thanks,<o:p></o:p></p></div><div><p = class=3DMsoNormal>Chandrashekar <o:p></o:p></p></div></div></div><p = class=3DMsoNormal><o:p> </o:p></p></div></div></body></html> ------=_NextPart_000_001A_01D03636.EA8B5C80--

Hi Donny, We don't have the libraries like expect or pexpect or sshpass or any other supported, to automate the process or logging into the machine and get the details of it. So, I just of thought of connecting RHEV-Manager using the REST API and get the details of it. Any suggestions would be really helpful. Thanks, Chandrashekar On Fri, Jan 23, 2015 at 12:01 AM, Donny Davis <donny@cloudspin.me> wrote:
When you add a host you will be able to see the details, and then you can place the host in maintenance mode to ensure no VM’s are brought up on it.
But if you just need the mac address, why not ssh into it and get it from ip addr
Donny D
*From:* users-bounces@ovirt.org [mailto:users-bounces@ovirt.org] *On Behalf Of *ChandraShekar Shastri *Sent:* Wednesday, January 21, 2015 6:28 AM *To:* users@ovirt.org *Subject:* [ovirt-users] Details of the host
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

On 22/01/15 19:31, Donny Davis wrote:
But if you just need the mac address, why not ssh into it and get it from ip addr
if you can ssh, there is no need to parse "ip" output, just do cat: cat /sys/class/net/$yourdevice/address I don't think there is a way to get data from a host via api which is not activated, but I might be wrong. -- Mit freundlichen Grüßen / Regards Sven Kieske Systemadministrator Mittwald CM Service GmbH & Co. KG Königsberger Straße 6 32339 Espelkamp T: +49-5772-293-100 F: +49-5772-293-333 https://www.mittwald.de Geschäftsführer: Robert Meyer St.Nr.: 331/5721/1033, USt-IdNr.: DE814773217, HRA 6640, AG Bad Oeynhausen Komplementärin: Robert Meyer Verwaltungs GmbH, HRB 13260, AG Bad Oeynhausen

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@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@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.

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@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@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@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.

On 01/24/2015 03:31 PM, ChandraShekar Shastri wrote:
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
The Python SDK only supports "Basic" authentication. Version 3.6 will also support Kerberos authentication. There are no plans at the moment to support any other authentication mechanism in the Python SDK.
On Fri, Jan 23, 2015 at 1:46 PM, Juan Hernández <jhernand@redhat.com <mailto:jhernand@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@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@internal', password='******', insecure=True, )
api.hosts.add( host = params.Host( name="myhost", address="myhost.example.com <http://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.
_______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users
-- 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.
participants (4)
-
ChandraShekar Shastri
-
Donny Davis
-
Juan Hernández
-
Sven Kieske