String getUniqueId(ClusterComputeResource ccr) { return computeUniqueId(ccr.getMOR()); }
ObjectNode toObjectNode(ClusterComputeResource ccr) { ObjectNode n = mapper.createObjectNode().put("vmw_name", ccr.getName()).put("id", computeUniqueId(ccr.getMOR())); return n; }
/** @since SDK4.1 */ public void cancelRecommendation(String key) throws RuntimeFault, RemoteException { getVimService().cancelRecommendation(getMOR(), key); }
public void applyRecommendation(String key) throws RuntimeFault, RemoteException { getVimService().applyRecommendation(getMOR(), key); }
/** * @since 4.0 */ public ClusterDasAdvancedRuntimeInfo retrieveDasAdvancedRuntimeInfo() throws RuntimeFault, RemoteException { return getVimService().retrieveDasAdvancedRuntimeInfo(getMOR()); } }
public void refreshRecommendation() throws RuntimeFault, RemoteException { getVimService().refreshRecommendation(getMOR()); }
/** * @since SDK5.0 */ public ClusterEnterMaintenanceResult clusterEnterMaintenanceMode(HostSystem[] hosts, OptionValue[] option) throws RuntimeFault, RemoteException { ManagedObjectReference[] hostMors = MorUtil.createMORs(hosts); return getVimService().clusterEnterMaintenanceMode(getMOR(), hostMors, option); }
public ClusterHostRecommendation[] recommendHostsForVm(VirtualMachine vm, ResourcePool pool) throws RuntimeFault, RemoteException { if(vm==null) { throw new IllegalArgumentException("vm must not be null."); } return getVimService().recommendHostsForVm(getMOR(), vm.getMOR(), pool==null? null : pool.getMOR()); }
public Task reconfigureCluster_Task(ClusterConfigSpec spec, boolean modify) throws RuntimeFault, RemoteException { ManagedObjectReference taskMOR = getVimService().reconfigureCluster_Task(getMOR(), spec, modify); return new Task(getServerConnection(), taskMOR); }
public Task moveInto_Task(HostSystem[] hosts) throws TooManyHosts, DuplicateName, InvalidState, RuntimeFault, RemoteException { if(hosts==null) { throw new IllegalArgumentException("hosts must not be null."); } ManagedObjectReference taskMOR = getVimService().moveInto_Task(getMOR(), MorUtil.createMORs(hosts)); return new Task(getServerConnection(), taskMOR); }
public Task moveHostInto_Task(HostSystem host, ResourcePool resourcePool) throws TooManyHosts, InvalidState, RuntimeFault, RemoteException { if(host==null) { throw new IllegalArgumentException("host must not be null."); } ManagedObjectReference taskMOR = getVimService().moveHostInto_Task(getMOR(), host.getMOR(), resourcePool==null? null : resourcePool.getMOR()); return new Task(getServerConnection(), taskMOR); }
public Task addHost_Task(HostConnectSpec spec, boolean asConnected, ResourcePool resourcePool, String license) throws InvalidLogin, HostConnectFault, RuntimeFault, RemoteException { ManagedObjectReference taskMOR = getVimService().addHost_Task(getMOR(), spec, asConnected, resourcePool==null? null : resourcePool.getMOR(), license); return new Task(getServerConnection(), taskMOR); }
protected void updateDatacenterClusterRelationship(Datacenter dc, ClusterComputeResource cluster) { logger.debug("updating relationship between dc={} and cluster={}", dc.getName(), cluster.getName()); String cypher = "match (d:VMWareDatacenter {id:{datacenterId} }), (c:VMWareCluster {id: {clusterId}}) MERGE (d)-[r:CONTAINS]->(c) ON CREATE SET r.updateTs=timestamp(),r.createTs=timestamp() ON MATCH SET r.updateTs=timestamp() return r"; getProjector().getNeoRxClient().execCypher(cypher, "datacenterId", computeUniqueId(dc.getMOR()), "clusterId", computeUniqueId(cluster.getMOR())); JsonNode vcenter = ensureController(); String vcenterid = vcenter.get("id").asText(); cypher = "match (c:ComputeController:VMWareVCenter {id:{vcenterId}}), (dc:VMWareDatacenter {id:{datacenterId} }) MERGE (c)-[r:MANAGES]->(dc) ON CREATE SET r.updateTs=timestamp() ON MATCH SET r.updateTs=timestamp() return r"; getProjector().getNeoRxClient().execCypher(cypher, "vcenterId", vcenterid, "datacenterId", computeUniqueId(dc.getMOR())); }