本文整理匯總了Java中com.vmware.vim25.ClusterDrsConfigInfo類的典型用法代碼示例。如果您正苦於以下問題:Java ClusterDrsConfigInfo類的具體用法?Java ClusterDrsConfigInfo怎麽用?Java ClusterDrsConfigInfo使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ClusterDrsConfigInfo類屬於com.vmware.vim25包,在下文中一共展示了ClusterDrsConfigInfo類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: isDrsEnabled
import com.vmware.vim25.ClusterDrsConfigInfo; //導入依賴的package包/類
public boolean isDrsEnabled() {
ComputeResourceConfigInfo cfg = ((ComputeResourceConfigInfo) getOrFail(
VimPath.res_configurationEx));
if (cfg instanceof ClusterConfigInfoEx) {
ClusterDrsConfigInfo drsConfig = ((ClusterConfigInfoEx) cfg).getDrsConfig();
return drsConfig == null || drsConfig.isEnabled();
} else {
return false;
}
}
示例2: main
import com.vmware.vim25.ClusterDrsConfigInfo; //導入依賴的package包/類
public static void main(String[] args) throws Exception
{
if(args.length!=4)
{
System.out.println("Usage: DrsModeChanger url username password mode");
System.exit(-1);
}
URL url = new URL(args[0]);
String username = args[1];
String password = args[2];
String mode = args[3];
String drs_obj_id = "domain-c5";
ServiceInstance si = new ServiceInstance(url, username, password, true);
ManagedObjectReference mref_drs = new ManagedObjectReference();
mref_drs.set_value(drs_obj_id);
mref_drs.setType("ClusterComputeResource");
ClusterComputeResource ccr = (ClusterComputeResource )MorUtil.createExactManagedEntity(si.getServerConnection(), mref_drs);
ClusterConfigSpec ccs = new ClusterConfigSpec();
ClusterDrsConfigInfo cdci = new ClusterDrsConfigInfo();
if("manual".equals(mode))
cdci.setDefaultVmBehavior(DrsBehavior.manual);
else
cdci.setDefaultVmBehavior(DrsBehavior.fullyAutomated);
cdci.setVmotionRate(new Integer(5));
ccs.setDrsConfig(cdci);
ccr.reconfigureCluster_Task(ccs, true);
si.getServerConnection().logout();
System.out.println("End of changing DRS config to " + args[3]);
}