xml - Creating Virtual Machines using PowerCLI based on data from CSV File -
i attempting find out how or whether possible create powercli script handle creating virtual machines (vm's) within specific clusters based on csv file.
i have found solutions involve having powercli read xml files , want determine if csv file data option , if so, how go doing it.
background: users input vm specification data excel 'request' form, vba script used translate data csv file , wondering if possible have powercli script read resulting csv files data create vm's specified values (to reviewed prior executing ensure data correct/relevant).
thank may provide
received vmware community site , able retrieve simple script create vms powercli:
#specify path of .csv file import vm settings $csvpath = "c:\newvmlist.csv" $csvfile = import-csv $csvpath $vmhost = get-vmhost "$($csvfile.vmhost)" $portgroup = get-virtualportgroup -name "$($csvfile.vlan)" -vmhost $vmhost new-vm -name "$($csvfile.name)" -memorygb "$($csvfile.memorygb)" -numcpu "$($csvfile.numcpu)" -portgroup $portgroup -diskgb "$($csvfile.c_system)"
Comments
Post a Comment