想在ESX上创建文件夹,发现有个老外写的比较详细
The CreateFolder() method needs to be called from either the vmFolder (VM/template view) or hostFolder (host/cluster view). You first need to get a reference to specific datacenter you want to create the folder and then from there you can get access tovmFolder or hostFolder as seen from datacenter managed object:http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/vim.Datacenter.html
但是用了他的方法之后,在执行到 CreateFolder()的时候就报错"The operation is not supported on the object."。
想不明白,但是确实是用这个方法才行,不解。。。
仔细想了想,此Folder非彼“Folder”
调用MakeDirectory()方法也能实现这个功能。