Vagrant Vsphere

138 views
Skip to first unread message

Stefaans Mostert

unread,
Jan 14, 2016, 3:46:11 AM1/14/16
to Vagrant

Allo all

Trying to use the vagrant-vsphere plugin.
Who can tell me how to find out what the resource pool for an environment is?
Yes, I have a useless VMware admin.

Steff


Alvaro Miranda Aguilera

unread,
Jan 14, 2016, 4:14:47 AM1/14/16
to vagra...@googlegroups.com
Hello Steff

Are several vsphere plugins, which one are you using?

If you are using this:

The resource pool is on the GUI that defines the rules of the VM.

You usually don’t needed. Test leaving that commented out.

You can deploy from template, or cloning a VM, try both.

This is how I created a multi-vm setup

To clone from a Template, you need:
        vsphere.template_name = 'oracle6-template'
        vsphere.linked_clone = false

ie

#name of vm to current directory
vm_prefix = "webserver"
#number of vms
vm_number = 1
#ram
vm_ram = 1024
#cpu
vm_cpu = 2

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

  config.vm.box = 'dummy'
  config.vm.box_url = '../dummy.box'
  config.vm.synced_folder ".", "/vagrant", disabled: true
  config.vm.provision "shell", run: "always", inline: "[ -f /etc/udev/rules.d/70-persistent-net.rules ] && rm -fr /etc/udev/rules.d/70-persistent-net.rules"

  config.ssh.username = 'root'
  config.ssh.password = 'root'
  config.ssh.forward_x11 = true

  (1..vm_number).each do |i|
    config.vm.define vm_name = "#{vm_prefix}%01d" % i do |config|
      config.vm.hostname = vm_name
      config.vm.provider :vsphere do |vsphere|
        vsphere.vm_base_path = 'vagrant-vsphere'  
        vsphere.name = vm_name
        vsphere.template_name = 'oracle6-template'
        vsphere.linked_clone = false
        vsphere.data_store_name = 'datastore1'
        vsphere.memory_mb = vm_ram
        vsphere.cpu_count = vm_cpu
        vsphere.host = '192.168.1.28'
        vsphere.insecure = true
        vsphere.compute_resource_name = '192.168.1.30'
        vsphere.user = 'admini...@kikitux.net'
        vsphere.password = '<password>'
      end
    end
  end
end



--
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/826a4507-2b3c-43b6-a780-9a415ec64c41%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

stefaans...@gmail.com

unread,
Jan 14, 2016, 4:35:31 AM1/14/16
to vagra...@googlegroups.com
Thanx

Will let you know how it goes...


Steff



For more options, visit https://groups.google.com/d/optout.



--
J Stefaans Mostert
Mobile: 0844634590
Fax: 0867300603
skype: mozzi_za (kuberboef)

Linux is simple. It just takes a genius to understand its simplicity.

stefaans...@gmail.com

unread,
Jan 19, 2016, 7:24:29 AM1/19/16
to vagra...@googlegroups.com
Allo all

I have the following.....


Vagrant.configure("2") do |config|
  config.vm.box = 'vsphere_dummy'
  config.vm.box_url = '/home/user/trusty64/vsphere_dummy.box'

  config.vm.provider :vsphere do |vsphere|
   # The vSphere host we're going to connect to
    vsphere.host = '10.1.202.246'

   # The ESX host for the new VM
    vsphere.compute_resource_name = '10.1.212.10'

    # The resource pool for the new VM
    vsphere.resource_pool_name = 'Vagrant'

    # The template we're going to clone
    vsphere.template_name = 'Elastic_tmp'
    vsphere.linked_clone = false

    vsphere.data_store_name = 'datastore1 (1)'

    # The name of the new machine
    vsphere.name = 'dev-ops'

    # vSphere login
    vsphere.user = 'ad...@vsphere.local'

    # vSphere password
    vsphere.password = 'password'

    # If you don't have SSL configured correctly, set this to 'true'
    vsphere.insecure = true
  end
end

When I run it I get the following.

user@box-nb:~/trusty64 > vagrant up --provider=vsphere
Bringing machine 'default' up with 'vsphere' provider...
Configured template/source VM could not be found

I am having huge issues here!



On Thu, Jan 14, 2016 at 11:14 AM, Alvaro Miranda Aguilera <kik...@gmail.com> wrote:

For more options, visit https://groups.google.com/d/optout.

Alvaro Miranda Aguilera

unread,
Jan 20, 2016, 12:22:16 AM1/20/16
to vagra...@googlegroups.com

On Wed, Jan 20, 2016 at 1:24 AM, stefaans...@gmail.com <stefaans...@gmail.com> wrote:
vsphere.data_store_name = 'datastore1 (1)'

Hello

The Template and the VM will be on that datastore?

Can you share an screenshot of the datatore with that name where the template is shown?

Thanks
Alvaro.
Reply all
Reply to author
Forward
0 new messages