Hi,
I am trying to create VM on a Storage POD. I have set all the parameters as in http://sourceforge.net/p/vijava/discussion/826592/thread/315e8db0,
I am getting invalid request all the time. Here is the sample code
StorageDrsVmConfigInfo vmconfigInfo = new StorageDrsVmConfigInfo();
vmconfigInfo.setBehavior(StorageDrsPodConfigInfoBehavior.automated.name());
VmPodConfigForPlacement vmPodConfig = new VmPodConfigForPlacement();
vmPodConfig.setStoragePod(storagePod.getMOR());
vmPodConfig.setVmConfig(vmconfigInfo);
//Storage Pod Sslection spec
StorageDrsPodSelectionSpec storageSelSpec = new StorageDrsPodSelectionSpec();
storageSelSpec.setStoragePod(storagePod.getMOR());
storageSelSpec.setInitialVmConfig(new VmPodConfigForPlacement[]{vmPodConfig});
VirtualMachineCloneSpec cloneSpec = new VirtualMachineCloneSpec();
cloneSpec.setPowerOn(true);
cloneSpec.setTemplate(false);
//Storage Placement spec
StoragePlacementSpec placementSpec = new StoragePlacementSpec();
placementSpec.setCloneName(vmName);
placementSpec.setVm(master.getMOR());
placementSpec.setCloneSpec(cloneSpec);
// placementSpec.setConfigSpec(new VirtualMachineConfigSpec());
placementSpec.setPodSelectionSpec(storageSelSpec);
placementSpec.setType(StoragePlacementSpecPlacementType.clone.name());
placementSpec.setFolder(folder.getMOR());
placementSpec.setHost(host.getMOR());
placementSpec.setResourcePool(resourcePool.getMOR());
StorageResourceManager service = new StorageResourceManager(serviceInstance.get().getServerConnection(), storagePod.getMOR());
StoragePlacementResult placementRes = service.recommendDatastores(placementSpec);
Task task = service.applyStorageDrsRecommendationToPod_Task(storagePod, placementRes.getRecommendations()[0].getKey());
I use vijava 5.1. But still getting same exception. Please help me in solving this. I am stuck.
Thank you in advance