前提
以下の環境にて動作確認
- Vagrantは1.8.1
- クライアントはMac OSX El Capitan
- OpenStack Juno
インストール手順
- Vagrant OpenStack plug-inの導入
$ vagrant plugin install vagrant-openstack-plugin
Installing the 'vagrant-openstack-plugin' plugin. This can take a few minutes...
Installed the plugin 'vagrant-openstack-plugin (0.12.0)'!
- dummy box の追加
$ vagrant box add dummy https://github.com/cloudbau/vagrant-openstack-plugin/raw/master/dummy.box
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'dummy' (v0) for provider:
box: Downloading: https://github.com/cloudbau/vagrant-openstack-plugin/raw/master/dummy.box
==> box: Successfully added box 'dummy' (v0) for 'openstack'!
$ vagrant box list
dummy (openstack, 0)
- Vagrantfileの作成
$ echo 'require "vagrant-openstack-plugin"
Vagrant.configure("2") do |config|
config.vm.box = "dummy"
# Make sure the private key from the key pair is provided
config.ssh.private_key_path = "~/.ssh/id_rsa"
config.vm.provider :openstack do |os|
os.username = "<user-name>" # e.g. "#{ENV['OS_USERNAME']}"
os.api_key = "<api-key>" # e.g. "#{ENV['OS_PASSWORD']}"
os.flavor = /m1.small/ # Regex or String
os.image = /CentOS/ # Regex or String
os.endpoint = "http://<os-auth-url>/tokens" # e.g. "#{ENV['OS_AUTH_URL']}/tokens"
os.keypair_name = "<key-pair-name>" # as stored in Nova
os.ssh_username = "centos" # login for the VM
os.network = "<network-name>" # optional
os.floating_ip = :auto # optional
os.server_name = "<instance-name>"
end
end' | tee Vagrantfile
- 起動
$ vagrant up --provider=openstack