Quantcast
Channel: VMware Communities : Discussion List - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 6251

CloneVm to SDRS Cluster / Storage Pod

$
0
0

Hi there,

 

we try to change our deployment scripts from old cloneVm to new recommendDatastores. We need this to provision VMs to SDRS Clusters. As documented within API reference, old CloneVm was now replaced by VcStorageResourceManager.recommendDatastores:

http://www.vmware.com/support/orchestrator/doc/vco_vsphere51_api/html/VcStorageResourceManager.html#recommendDatastores

 

Now we build the following scriptable task:

var myVcVirtualMachineConfigSpec            = new VcVirtualMachineConfigSpec();
var myVcResourceAllocationInfo                = new VcResourceAllocationInfo();
var myVcStoragePlacementSpec                = new VcStoragePlacementSpec();
var myVcStorageDrsPodSelectionSpec            = new VcStorageDrsPodSelectionSpec();
var myVcStorageResourceManager                = input_Datacenter.sdkConnection.storageResourceManager();
var myVcRessourcePool                        = input_RessourcePool;
var myVcVirtualMachineCustomSpec            = input_VirtualMachineCustomSpec;


myVcStorageDrsPodSelectionSpec.storagePod    = input_StoragePod;


myVcVirtualMachineRelocateSpec                = System.getModule("com.vmware.library.vc.vm.spec").getRelocateSpec(null,null,null,myVcRessourcePool,null) ;
myVcVirtualMachineCloneSpec                    = System.getModule("com.vmware.library.vc.vm.spec").getCloneSpec(null,myVcVirtualMachineCustomSpec,myVcRessourcePool,false,false) ;



myVcStoragePlacementSpec.cloneName            = input_VirtualMachineName;
myVcStoragePlacementSpec.cloneSpec            = myVcVirtualMachineCloneSpec;
myVcStoragePlacementSpec.folder                = input_Folder;
myVcStoragePlacementSpec.podSelectionSpec    = myVcStorageDrsPodSelectionSpec;
myVcStoragePlacementSpec.resourcePool        = myVcRessourcePool;
myVcStoragePlacementSpec.type                = VcStoragePlacementSpecPlacementType.clone;
myVcStoragePlacementSpec.vm                    = input_Template;

x = input_Datacenter.sdkConnection.storageResourceManager.recommendDatastores(myVcStoragePlacementSpec);

System.warn("Recommend Result: " + x);
System.warn("recommendations.key: " + x.recommendations.key);
System.warn("recommendations.reason: " + x.recommendations.reason);
System.warn("recommendations.reasontext: " + x.recommendations.reasonText);
System.warn("recommendations.action: " + x.recommendations.action);
System.warn("recommendations.target: " + x.recommendations.target);
System.warn("recommendations.type: " + x.recommendations.type);
System.warn("recommendations.dynamicProperty: " + x.dynamicProperty);

 

 

We get no error message and no task is starting. But on displaying all our warnings, they are all undefined without the x which is the correct object:

[2012-10-08 15:04:27.854] [W] Recommend Result: DynamicWrapper (Instance) : [VcStoragePlacementResult]-[class com.vmware.vim.vi4.StoragePlacementResult] -- VALUE : com.vmware.vim.vi4.StoragePlacementResult@6465a5b0
[2012-10-08 15:04:27.854] [W] recommendations.key: undefined
[2012-10-08 15:04:27.854] [W] recommendations.reason: undefined
[2012-10-08 15:04:27.870] [W] recommendations.reasontext: undefined
[2012-10-08 15:04:27.870] [W] recommendations.action: undefined
[2012-10-08 15:04:27.870] [W] recommendations.target: undefined
[2012-10-08 15:04:27.870] [W] recommendations.type: undefined
[2012-10-08 15:04:27.870] [W] recommendations.dynamicProperty: null

 

Someone ever tried this or has any idea about get this done?

 

Regards,

Chris


Viewing all articles
Browse latest Browse all 6251

Trending Articles



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