lost and found ( for me ? )

run multiple VMs with vagrant

$ vagrant --version
Vagrant 1.7.2

$ tail -1 /etc/lsb-release

initialize a project.
$ vagrant box list
trusty64 (libvirt, 0)
trusty64 (virtualbox, 0)

$ vagrant init trusty64

edit Vagrantfile
$ cat Vagrantfile
Vagrant.configure(2) do |config|

 config.vm.define "server01" do |server01|
   server01.vm.box = "trusty64"

 config.vm.define "server02" do |server02|
   server02.vm.box = "trusty64"


run VMs
I have used libvirt as its provider.
$ vagrant up server01 --provider=libvirt

$ vagrant up server02 --provider=libvirt

$ virsh list --all
Id    Name                           State
2     Vagrant_works_server01             running
3     Vagrant_works_server02             running

$ vagrant status
Current machine states:

server01                  running (libvirt)
server02                  running (libvirt)

access to the VMs
$ vagrant ssh server01

$ vagrant ssh server02

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.