List<VirtualDeviceSpec> deviceSpecs =
new ArrayList<VirtualDeviceSpec>();
for (DeviceId slot : vcVm.getVirtualDiskIds()) {
SharesInfo shares = new SharesInfoImpl();
shares.setLevel(Level.valueOf(ioShares.toString().toLowerCase()));
IOAllocationInfo allocationInfo = new IOAllocationInfoImpl();
allocationInfo.setShares(shares);
VirtualDisk vmdk = (VirtualDisk) vcVm.getVirtualDevice(slot);
vmdk.setStorageIOAllocation(allocationInfo);
VirtualDeviceSpec spec = new VirtualDeviceSpecImpl();
spec.setOperation(VirtualDeviceSpec.Operation.edit);
spec.setDevice(vmdk);