Pages

Friday, March 11, 2016

Map KVM Domain to Open Stack Instance With IP Address

Map KVM Domain to Open Stack Instance With IP Address

Objective is to Map the VM at KVM Level with Open Stack Instance and show IP Address of that Particular VM.

For KVM to Open Stack Mapping, You shall see this link

http://blogforopensource.blogspot.com/2016/01/find-openstack-instance-from-kvm.html 

Now How to Map with IP Address (ie.) Find the IP Address of the VM with API

Get the User ID, Display Name of the VM with UUID. (Connecting to Nova Database). The following Query will get the required results.

select user_id,display_name from instances where uuid='XYZ'

  1. Now Use the Python Nova Client API, iterate the server list. 
  2. Nova Client API provides User ID, Display Name of a Server.
  3. Now Compare the User ID and the Display Name obtained in DB with API. 
  4. This will give the IP Addresses of the VM

Code Reference: 

https://ask.openstack.org/en/question/50087/list-all-servers-with-python-nova-client/

Sample Code is shown below

No comments:

Post a Comment