/** * Generates a human-readable name for a performance counter. * * @param perfCounterInfo the perfomance counter info object * @return a string-representation of the performance counter's name */ private String getHumanReadableName(PerfCounterInfo perfCounterInfo) { return perfCounterInfo.getGroupInfo().getKey() + "." + perfCounterInfo.getNameInfo().getKey() + "." + perfCounterInfo.getRollupType().toString(); }
private VirtualDeviceConfigSpec createFloppyConfigSpecs() { VirtualFloppyDeviceBackingInfo flpBacking = new VirtualFloppyDeviceBackingInfo(); flpBacking.setDeviceName(DEFAULT_FLOPPY_DEVICE_NAME); VirtualFloppy floppyDisk = new VirtualFloppy(); floppyDisk.setBacking(flpBacking); floppyDisk.setKey(DEFAULT_FLOPPY_DEVICE_KEY); VirtualDeviceConfigSpec flpSpecs = new VirtualDeviceConfigSpec(); flpSpecs.setOperation(VirtualDeviceConfigSpecOperation.ADD); flpSpecs.setDevice(floppyDisk); return flpSpecs; }
private String getNetworkName(ConfigTarget configTarget) { if (configTarget.getNetwork() != null) { for (VirtualMachineNetworkInfo network : configTarget.getNetwork()) { NetworkSummary netSummary = network.getNetwork(); if (netSummary.isAccessible()) { return netSummary.getName(); } } } return null; }
private PropertyFilterSpec propertyFilterSpec(ManagedObjectReference objmor, String[] filterProps) { ObjectSpec oSpec = new ObjectSpec(); oSpec.setObj(objmor); oSpec.setSkip(false); PropertySpec pSpec = new PropertySpec(); pSpec.getPathSet().addAll(Arrays.asList(filterProps)); pSpec.setType(objmor.getType()); PropertyFilterSpec spec = new PropertyFilterSpec(); spec.getObjectSet().add(oSpec); spec.getPropSet().add(pSpec); return spec; }
private VirtualDeviceConfigSpec getFirstScsiController(int diskCtrlKey) { VirtualLsiLogicController scsiCtrl = new VirtualLsiLogicController(); scsiCtrl.setBusNumber(DEFAULT_CONTROLLER_BUS_NUMBER); scsiCtrl.setKey(diskCtrlKey); scsiCtrl.setSharedBus(VirtualSCSISharing.NO_SHARING); VirtualDeviceConfigSpec scsiCtrlSpec = new VirtualDeviceConfigSpec(); scsiCtrlSpec.setOperation(VirtualDeviceConfigSpecOperation.ADD); scsiCtrlSpec.setDevice(scsiCtrl); return scsiCtrlSpec; }
private VirtualEthernetCard getEth(String fileName, String addressType, Integer key) { VirtualEthernetCardNetworkBackingInfo nicBacking = new VirtualEthernetCardNetworkBackingInfo(); nicBacking.setDeviceName(fileName); VirtualEthernetCard nic = new VirtualPCNet32(); nic.setBacking(nicBacking); nic.setAddressType(addressType); nic.setKey(key); return nic; }
private static VirtualDevice findVirtualDevice( VirtualMachineConfigInfo vmConfig, String name) { VirtualDevice[] devices = vmConfig.getHardware().getDevice(); for (int i = 0; i < devices.length; i++) { if (devices[i].getDeviceInfo().getLabel().equals(name)) { return devices[i]; } } return null; }
static MethodAction createPowerOnAction() { MethodAction action = new MethodAction(); action.setName("PowerOnVM_Task"); MethodActionArgument argument = new MethodActionArgument(); argument.setValue(null); action.setArgument(new MethodActionArgument[] { argument }); return action; }
private static HostVirtualNicSpec createVNicSpecification(String ipAddr) { HostVirtualNicSpec vNicSpec = new HostVirtualNicSpec(); HostIpConfig ipConfig = new HostIpConfig(); ipConfig.setDhcp(false); ipConfig.setIpAddress(ipAddr); ipConfig.setSubnetMask("255.255.255.0"); vNicSpec.setIp(ipConfig); return vNicSpec; }
public ManagedObjectReference findVmByIp(String ip) throws RuntimeFaultFaultMsg { return vimPort.findByIp(this.serviceContent.getSearchIndex(), null, ip, true); }
public ManagedObjectReference findVmByUuid(String uuid, boolean instanceUuid) throws RuntimeFaultFaultMsg { return vimPort.findByUuid(this.serviceContent.getSearchIndex(), null, uuid, true, instanceUuid); }
static VirtualDeviceConfigSpec createScsiSpec(int cKey) { VirtualDeviceConfigSpec scsiSpec = new VirtualDeviceConfigSpec(); scsiSpec.setOperation(VirtualDeviceConfigSpecOperation.add); VirtualLsiLogicController scsiCtrl = new VirtualLsiLogicController(); scsiCtrl.setKey(cKey); scsiCtrl.setBusNumber(0); scsiCtrl.setSharedBus(VirtualSCSISharing.noSharing); scsiSpec.setDevice(scsiCtrl); return scsiSpec; }
/** * Generates a human-readable name for a performance counter. * * @param perfCounterInfo the perfomance counter info object * @return a string-representation of the performance counter's name */ private String getHumanReadableName(PerfCounterInfo perfCounterInfo) { return perfCounterInfo.getGroupInfo().getKey() + "." + perfCounterInfo.getNameInfo().getKey() + "." + perfCounterInfo.getRollupType().toString(); }
private static VirtualDevice findVirtualDevice( VirtualMachineConfigInfo vmConfig, String name) { VirtualDevice [] devices = vmConfig.getHardware().getDevice(); for(int i=0;i<devices.length;i++) { if(devices[i].getDeviceInfo().getLabel().equals(name)) { return devices[i]; } } return null; }
static MethodAction createPowerOnAction() { MethodAction action = new MethodAction(); action.setName("PowerOnVM_Task"); MethodActionArgument argument = new MethodActionArgument(); argument.setValue(null); action.setArgument(new MethodActionArgument[] { argument }); return action; }
private static HostVirtualNicSpec createVNicSpecification(String ipAddr) { HostVirtualNicSpec vNicSpec = new HostVirtualNicSpec(); HostIpConfig ipConfig = new HostIpConfig(); ipConfig.setDhcp(false); ipConfig.setIpAddress(ipAddr); ipConfig.setSubnetMask("255.255.255.0"); vNicSpec.setIp(ipConfig); return vNicSpec; }
private String getHumanReadableName(PerfCounterInfo perfCounterInfo) { return perfCounterInfo.getGroupInfo().getKey() + "." + perfCounterInfo.getNameInfo().getKey() + "." + perfCounterInfo.getRollupType().toString(); }
private static VirtualDevice findVirtualDevice( VirtualMachineConfigInfo vmConfig, String name) { VirtualDevice [] devices = vmConfig.getHardware().getDevice(); for(int i=0;i<devices.length;i++) { if(devices[i].getDeviceInfo().getLabel().equals(name)) { return devices[i]; } } return null; }
static MethodAction createPowerOnAction() { MethodAction action = new MethodAction(); action.setName("PowerOnVM_Task"); MethodActionArgument argument = new MethodActionArgument(); argument.setValue(null); action.setArgument(new MethodActionArgument[] { argument }); return action; }
static MethodAction createPowerOnAction() { MethodAction action = new MethodAction(); action.setName("PowerOnVM_Task"); MethodActionArgument argument = new MethodActionArgument(); argument.setValue(null); action.setArgument(new MethodActionArgument[] { argument }); return action; }