2018 tarihine ait yayınlar gösteriliyor

create Virtual Machines in VMware with ansible


Mainly I am a system administrator. To live freely, I work  project based and I give trainings. In my current project, I have some additional roles which include managing a vmware environment.

I must create new VMs in vsphere 6.5 environment fast. I have ansible under by belt. so here how I have done this.

Scenario: I have 5 VMs to create. My config files are the following;

testVM.csv: this includes VM properties such as datastore, Network config etc. My each VM has 3 NICs.. If you need less, then you can trim these items in the csv filemakeVM.yml: it creates VMs according to testVM.csv file. you will need Pyvmomi python library. you can install it with pipcreds.txt: vcenter credentials are herehosts file: this must include only one IP. otherwise ansible tries to create a VM for each host in this file..

csv file format: