How to get newly created machine details in Vagrant-Openstack plugin

37 views
Skip to first unread message

Malintha Adikari

unread,
Sep 15, 2015, 1:19:29 AM9/15/15
to Vagrant

I am using Openstack as my provider and I could create openstack instance using my Vagrant script. In Vagrant script I am using


os.floating_ip  = :auto


for assigning floating IP address to my openstack instances. How can I get newly created machine info within the same Vagrant script after it has been created?  I want to get the floating IP address that has been assigned automatically to that machine.

Following is my script


Vagrant.configure("2") do |config|

config.vm.box = "dummy"
config.vm.synced_folder '.', '/vagrant', disabled: true

config.ssh.private_key_path = "/home/xxxxx"

config.vm.provider :openstack do |os|
os.username     = "xxx"
os.api_key      = "xxx"
os.flavor       = "m1.medium"
os.image        = "ubuntu14.04"
os.endpoint     = "http://xxx"
os.keypair_name = "xxx"
os.floating_ip  = :auto
os.floating_ip_pool   = "xxx"
os.ssh_username = "ubuntu"
os.network      = "xxx"
os.server_name  = "TestInstant"
end
end

Alvaro Miranda Aguilera

unread,
Sep 15, 2015, 5:38:34 AM9/15/15
to vagra...@googlegroups.com
does vagrant ssh-config provide the information you are after?

Thanks
Alvaro.
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in violation
> of those guidelines may result in your removal from this mailing list.
>
> GitHub Issues: https://github.com/mitchellh/vagrant/issues
> IRC: #vagrant on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Vagrant" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vagrant-up+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vagrant-up/25798940-970b-4844-a6d2-ae34ad33a3a0%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Malintha Adikari

unread,
Sep 15, 2015, 5:43:47 AM9/15/15
to Vagrant
Yes, thank you for the answer , vagrant ssh-config provides information I needed through my shell (terminal). Is there any similar "ruby" command to get machine information ? I have some operations to do after creating instances , using assigned floating IPs. 
Reply all
Reply to author
Forward
0 new messages