@Scheduled(fixedRateString = "${collection.interval:30000}") public void forwardMetricsToInsights() throws InvalidProperty, RuntimeFault, RemoteException { long start = startTiming(); int datastoreCount = 0; for (String name : datastores) { Datastore datastore = (Datastore) inventoryNavigator.searchManagedEntity("Datastore", name); if (datastore != null) { Map<String, Object> attributes = Maps.newHashMap(); attributes.put("platform_instance", cfInstanceName); attributes.put("type", "datastore"); attributes.put("name", name); attributes.put("capacity", bytesToGb(datastore.getSummary().getCapacity())); attributes.put("free_space", bytesToGb(datastore.getSummary().getFreeSpace())); attributes.put("uncommitted", bytesToGb(datastore.getSummary().getUncommitted())); insights.recordCustomEvent("cf_iaas_metrics", attributes); datastoreCount++; } else { LOG.error("Unable to find datastore {}", name); } } endTiming(start, datastoreCount); }
private VirtualMachineRelocateSpec configureRelocateSpec(ResourcePool resourcePool, Datastore datastore, VirtualMachine master) throws Exception, InvalidProperty, RuntimeFault, RemoteException { VirtualMachineRelocateSpec rSpec = new VirtualMachineRelocateSpec(); if (cloningStrategy.equals("linked")) { ArrayList<Integer> diskKeys = getIndependentVirtualDiskKeys(master); if (diskKeys.size() > 0) { Datastore[] dss = master.getDatastores(); VirtualMachineRelocateSpecDiskLocator[] diskLocator = new VirtualMachineRelocateSpecDiskLocator[diskKeys.size()]; int count = 0; for (Integer key : diskKeys) { diskLocator[count] = new VirtualMachineRelocateSpecDiskLocator(); diskLocator[count].setDatastore(dss[0].getMOR()); diskLocator[count] .setDiskMoveType(VirtualMachineRelocateDiskMoveOptions.moveAllDiskBackingsAndDisallowSharing .toString()); diskLocator[count].setDiskId(key); count = count + 1; } rSpec.setDiskMoveType(VirtualMachineRelocateDiskMoveOptions.createNewChildDiskBacking.toString()); rSpec.setDisk(diskLocator); } else { rSpec.setDiskMoveType(VirtualMachineRelocateDiskMoveOptions.createNewChildDiskBacking.toString()); } } else if (cloningStrategy.equals("full")) { rSpec.setDatastore(datastore.getMOR()); rSpec.setPool(resourcePool.getMOR()); //rSpec.setHost(); } else throw new Exception(String.format("Cloning strategy %s not supported", cloningStrategy)); return rSpec; }
/** * Create an instance of {@link JAXBElement }{@code <}{@link RuntimeFault }{@code >}} * */ @XmlElementDecl(namespace = "urn:pbm", name = "RuntimeFaultFault") public JAXBElement<RuntimeFault> createRuntimeFaultFault(RuntimeFault value) { return new JAXBElement<RuntimeFault>(_RuntimeFaultFault_QNAME, RuntimeFault.class, null, value); }
@Override public Task moveDatastoreFileTask(String sourceName, Datacenter sourceDatacenter, String destinationName, Datacenter destinationDatacenter, boolean force) throws FileFault, InvalidDatastore, RuntimeFault, RemoteException { return null; //To change body of implemented methods use File | Settings | File Templates. }
Task copyVirtualDiskTask(String sourceName, Datacenter sourceDatacenter, String destName, Datacenter destDatacenter, VirtualDiskSpec destSpec, Boolean force) throws FileFault, RuntimeFault, RemoteException;
CustomFieldDef addCustomFieldDef(String name, String moType, PrivilegePolicyDef fieldDefPolicy, PrivilegePolicyDef fieldPolicy) throws DuplicateName, InvalidPrivilege, RuntimeFault, RemoteException;
/** * @since SDK4.1 */ List<DistributedVirtualSwitchManagerCompatibilityResult> queryDvsCheckCompatibility( DistributedVirtualSwitchManagerHostContainer hostContainer, DistributedVirtualSwitchManagerDvsProductSpec dvsProductSpec, List<DistributedVirtualSwitchManagerHostDvsFilterSpec> hostFilterSpec) throws RuntimeFault, RemoteException;
/** * @since 4.0 */ void acknowledgeAlarm(Alarm alarm, ManagedEntity entity) throws RuntimeFault, RemoteException;
/** * @since 4.0 */ boolean areAlarmActionsEnabled(ManagedEntity entity) throws RuntimeFault, RemoteException;
/** * @since 4.0 */ void enableAlarmActions(ManagedEntity entity, boolean enabled) throws RuntimeFault, RemoteException;
/** * @since SDK5.1 */ String allocateIpv6Address(Datacenter dc, int poolId, String allocationId) throws RuntimeFault, RemoteException;
/** * @since SDK4.0 */ UserSession loginExtensionByCertificate(String extensionKey, String locale) throws InvalidLogin, InvalidLocale, NoClientCertificate, RuntimeFault, RemoteException;
/** * @since SDK5.0 */ SessionManagerGenericServiceTicket acquireGenericServiceTicket(SessionManagerServiceRequestSpec spec) throws RuntimeFault, RemoteException;
/** * @since SDK4.0 */ void updateLicenseLabel(String licenseKey, String labelKey, String labelValue) throws RuntimeFault, RemoteException;
/** * SDK4.1 signature for back compatibility */ List<ProfileExpressionMetadata> queryExpressionMetadata(List<String> expressionName) throws RuntimeFault, RemoteException;
/** * SDK5.0 signature */ List<ProfilePolicyMetadata> queryPolicyMetadata(List<String> policyName, Profile profile) throws RuntimeFault, RemoteException;
/** * @since SDK5.0 */ Task rectifyDvsOnHostTask(List<HostSystem> hosts) throws DvsFault, RuntimeFault, RemoteException;
/** * @since SDK5.1 */ List<ExtensionManagerIpAllocationUsage> queryExtensionIpAllocationUsage(List<String> extensionKeys) throws RuntimeFault, RemoteException;
/** * @since SDK5.0 */ List<ManagedEntity> queryManagedBy(String extensionKey) throws RuntimeFault, RemoteException;
/** * Un-register an existing plugin * If <code>keyStr</code> is null then a <code>NullPointerException</code> * is thrown. * * @param keyStr The unique key of the plugin * @throws RemoteException * @throws RuntimeFault * @throws com.vmware.vim25.NotFound either because of the web service itself, or because of the service * provider unable to handle the request. */ void unregisterExtension(String keyStr) throws NotFound, RuntimeFault, RemoteException;
/** * Update an existing plugin with modified information * If <code>extension</code> is null then a <code>NullPointerException</code> is thrown. * * @param extension The extension object with updated information * @throws RemoteException * @throws RuntimeFault * @throws NotFound either because of the web service itself, or because of the service * provider unable to handle the request. */ void updateExtension(Extension extension) throws NotFound, RuntimeFault, RemoteException;
/** * Register a new plugin * If <code>extension</code> is null then a <code>NullPointerException</code> is thrown. * * @param extension The extension object to be registered * @throws RemoteException * @throws RuntimeFault either because of the web service itself, or because of the service * provider unable to handle the request. */ void registerExtension(Extension extension) throws RuntimeFault, RemoteException;
/** * Find the extension based on the unique key of the plugin * If <code>keyStr</code> is null then a <code>NullPointerException</code> * * @param keyStr The unique key for the plugin * @return The extension object found with the unique key * @throws RemoteException * @throws RuntimeFault * @throws RemoteException if something is wrong with web service call, * either because of the web service itself, or because of the service * provider unable to handle the request. */ Extension findExtension(String keyStr) throws RuntimeFault, RemoteException;
/** * @since SDK4.0 */ List<ScheduledTask> retrieveObjectScheduledTask(ManagedObject obj) throws RuntimeFault, RemoteException;
/** * @since SDK4.0 * This method is called in the cloneSession method. If you happen to use this method, * please double check if it's really needed. */ String acquireCloneTicket() throws RuntimeFault, RemoteException;
/** * SDK5.0 signature */ Task applyHostConfigTask(HostSystem host, HostConfigSpec configSpec, List<ProfileDeferredPolicyOptionParameter> userInputs) throws HostConfigFailed, InvalidState, RuntimeFault, RemoteException;
/** * SDK2.5 signature for back compatibility */ Task extendVirtualDiskTask(String name, Datacenter datacenter, long newCapacityKb) throws FileFault, RuntimeFault, RemoteException;
/** * SDK4.1 signature for back compatibility */ ApplyProfile createDefaultProfile(String profileType) throws RuntimeFault, RemoteException;
/** * SDK5.0 signature */ ApplyProfile createDefaultProfile(String profileType, String profileTypeName, Profile profile) throws RuntimeFault, RemoteException;
/** * @since SDK5.0 */ Task exportAnswerFileTask(HostSystem host) throws RuntimeFault, RemoteException;
/** * @since SDK5.0 */ List<AnswerFileStatusResult> queryAnswerFileStatus(List<HostSystem> hosts) throws RuntimeFault, RemoteException;
/** * SDK5.0 signature */ List<ProfileExpressionMetadata> queryExpressionMetadata(List<String> expressionName, Profile profile) throws RuntimeFault, RemoteException;
/** * @since SDK5.1 */ UserSession loginByToken(String locale) throws InvalidLogin, InvalidLocale, RuntimeFault, RemoteException;
/** * @since SDK5.1 */ AnswerFile retrieveAnswerFileForProfile(HostSystem host, HostApplyProfile applyProfile) throws RuntimeFault, RemoteException;
/** * @since SDK5.0 */ Task updateAnswerFileTask(HostSystem host, AnswerFileCreateSpec configSpec) throws AnswerFileUpdateFailed, RuntimeFault, RemoteException;
/** * @since SDK5.1 */ Task dVSManagerExportEntityTask(List<SelectionSet> selectionSet) throws BackupBlobWriteFailure, NotFound, RuntimeFault, RemoteException;
/** * @since SDK4.0 */ Task eagerZeroVirtualDiskTask(String name, Datacenter datacenter) throws FileFault, RuntimeFault, RemoteException;
/** * @since SDK5.0 */ List<Boolean> HasPrivilegeOnEntity(ManagedEntity entity, String sessionId, List<String> privId) throws RuntimeFault, RemoteException;
/** * @since SDK4.0 */ LicenseManagerLicenseInfo addLicense(String licenseKey, KeyValue[] labels) throws RuntimeFault, RemoteException;
Task inflateVirtualDiskTask(String name, Datacenter datacenter) throws FileFault, RuntimeFault, RemoteException;