<div dir="ltr">Awesome, let me give this a shot and see if it helps</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 1, 2017 at 10:00 AM, Juan Hernández <span dir="ltr"><<a href="mailto:jhernand@redhat.com" target="_blank">jhernand@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 03/01/2017 04:53 PM, Marc Young wrote:<br>
> What feels hacky is that I have so little information about the VM i'm<br>
> running from within that I'd have a hard time crawling the API enough to<br>
> know the information I got was about the VM I'm testing against. Per my<br>
> later email the ID in /var/lib/cloud/data/instance-<wbr>id is not the same<br>
> that I'd need to hit the REST API to describe<br>
><br>
<br>
</span>I'd suggest you create the virtual machines assigning them a BIOS serial<br>
number that helps you find them via the API. Easiest is to create them<br>
so that the BIOS serial number is the id of the VM in ovirt. You have an<br>
exmaple of how to set the serial number policy here:<br>
<br>
<br>
<a href="https://github.com/oVirt/ovirt-engine-sdk-ruby/blob/master/sdk/examples/set_vm_serial_number.rb" rel="noreferrer" target="_blank">https://github.com/oVirt/<wbr>ovirt-engine-sdk-ruby/blob/<wbr>master/sdk/examples/set_vm_<wbr>serial_number.rb</a><br>
<br>
In your case you probably want to do this:<br>
<br>
vm_service.update(<br>
serial_number: {<br>
policy: OvirtSDK4::SerialNumberPolicy:<wbr>:VM<br>
}<br>
)<br>
<span class=""><br>
> On Wed, Mar 1, 2017 at 9:45 AM, Yaniv Kaul <<a href="mailto:ykaul@redhat.com">ykaul@redhat.com</a><br>
</span><span class="">> <mailto:<a href="mailto:ykaul@redhat.com">ykaul@redhat.com</a>>> wrote:<br>
><br>
><br>
><br>
> On Wed, Mar 1, 2017 at 4:53 PM Marc Young <<a href="mailto:3vilpenguin@gmail.com">3vilpenguin@gmail.com</a><br>
</span><span class="">> <mailto:<a href="mailto:3vilpenguin@gmail.com">3vilpenguin@gmail.com</a>><wbr>> wrote:<br>
><br>
> Ive looked through what documentation I can find and i only come<br>
> up on bug reports from years ago, but: is there anyway to get<br>
> metadata about a oVirt server metadata from the context of a VM<br>
> ? cloud-init supports a metadata service that sits<br>
> on 169.254.169.254 to retrieve info like instance-id etc. This<br>
> is very useful in AWS which I'm familiar with.<br>
><br>
><br>
> We support cloud-init via config drive, not over the network.<br>
><br>
><br>
><br>
> My context is that I'd like to run some assertions against a VM<br>
> and the test framework I'm using runs all assertions from within<br>
> the VM itself. So If i wanted to assert that the host running my<br>
</span>> VM is "<a href="http://x.foo.com" rel="noreferrer" target="_blank">x.foo.com</a> <<a href="http://x.foo.com" rel="noreferrer" target="_blank">http://x.foo.com</a>>" I'd have to be able to<br>
<span class="">> retrieve that from within the VM. I can do that via the REST API<br>
> but that requires me to get a REST user/pass inside the vm and<br>
> feels hacky. The common way of doing this at openstack/aws is to<br>
> curl the metadata service which replies with information only<br>
> relevant to the machine asking.<br>
><br>
><br>
> Feels OK to me - doesn't sound too hacky to me.<br>
> You can do it via Ansible, but still need creds.<br>
> I don't remember if anything in the VM BIOS (dmidecode) will help<br>
> you there - I think not.<br>
> Y.<br>
><br>
><br>
> ______________________________<wbr>_________________<br>
> Devel mailing list<br>
</span>> <a href="mailto:Devel@ovirt.org">Devel@ovirt.org</a> <mailto:<a href="mailto:Devel@ovirt.org">Devel@ovirt.org</a>><br>
> <a href="http://lists.ovirt.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.ovirt.org/<wbr>mailman/listinfo/devel</a><br>
> <<a href="http://lists.ovirt.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.ovirt.org/<wbr>mailman/listinfo/devel</a>><br>
<div class="HOEnZb"><div class="h5">><br>
><br>
><br>
><br>
> ______________________________<wbr>_________________<br>
> Devel mailing list<br>
> <a href="mailto:Devel@ovirt.org">Devel@ovirt.org</a><br>
> <a href="http://lists.ovirt.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.ovirt.org/<wbr>mailman/listinfo/devel</a><br>
><br>
<br>
</div></div></blockquote></div><br></div>