Quantcast
Channel: VMware Communities : Discussion List - VMware {code}
Viewing all articles
Browse latest Browse all 2738

Having trouble with Clone vApp

$
0
0

i have a vApp that has about 7 vms in it. I'd like to use python to Clone the vApp. Here is what i have but it's failing

template = get_obj(content, [vim.VirtualApp], "vAppTemplate")
destfolder = get_obj(content, [vim.Folder], "My vApp Folder")
datastore = get_obj(content, [vim.Datastore], "My Datastore")
cluster = get_obj(content, [vim.ClusterComputeResource], "My Cluster")
resource_pool = cluster.resourcePool
vappnet = vim.vApp.CloneSpec.NetworkMappingPair
vappnet.destination = get_obj(content, [vim.Network], 'LAN-106')
vappnet.source = get_obj(content, [vim.Network], 'LAN-100')
vappconf = vim.vApp.CloneSpec
vappconf.location = datastore
vappconf.vmfolder = destfolder
vappconf.networkmapping = vappnet
task = template.Clone("vAppClone", resource_pool, vappconf)
wait_for_task(task)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyVmomi/VmomiSupport.py", line 972, in CheckField
% (info.name, info.type.__name__, valType.__name__))
TypeError: For "spec" expected type vim.vApp.CloneSpec, but got LazyType


Viewing all articles
Browse latest Browse all 2738

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>