今天介紹, vsphere plugin
主要是翻譯自 連結
安裝 plugin
vagrant plugin install vagrant-vsphere
如同我們之前所說,像Vsphere 這樣不屬於 local vm 的,我們用
dummy box 來取代原來的 box 設定
$ tar cvzf dummy.box ./metadata.json
建立完這個box 後,加到 box list
$ vagrant box add dummy.box --name dummy
Vagrant.configure("2") do |config|
config.vm.box = 'dummy'
config.vm.box_url = './example_box/dummy.box'
config.vm.provider :vsphere do |vsphere|
vsphere.host = 'HOST NAME OF YOUR VSPHERE INSTANCE'
vsphere.compute_resource_name = 'YOUR COMPUTE RESOURCE'
vsphere.resource_pool_name = 'YOUR RESOURCE POOL'
vsphere.template_name = 'YOUR VM TEMPLATE'
vsphere.name = 'NEW VM NAME'
vsphere.user = 'YOUR VMWARE USER'
vsphere.password = 'YOUR VMWARE PASSWORD'
end
end
最後用
vagrant up --provider=vsphere
開啟 vm