public static string getCIMSessionId(Vim25Api.ManagedObjectReference hmor1, String[] args, Cookie cookie) { AppUtil.AppUtil ecb = null; try { ecb = AppUtil.AppUtil.initialize("GetCIMSessioId" , args); ecb.connect(cookie); _service = ecb.getConnection()._service; _sic = ecb.getConnection().ServiceContent; ManagedObjectReference hmor = VersionUtil.convertManagedObjectReference(hmor1); string sessionId = _service.AcquireCimServicesTicket(hmor).sessionId; return(sessionId); } catch (Exception e) { ecb.log.LogLine("Get GetSessionID : Failed Connect"); throw e; } finally { ecb.log.LogLine("Ended GetSessionID"); ecb.log.Close(); } }
private void getVersion(String[] args, VMotion vmotionObj) { String vmname = cb.get_option("vmname"); String sourcehost = cb.get_option("sourcehost"); String targethost = cb.get_option("targethost"); String targetpool = cb.get_option("targetpool"); String dataname = cb.get_option("targetdatastore"); if (cb.option_is_set("validate")) { provisionChkr = cb.getConnection().ServiceContent.vmProvisioningChecker; Console.WriteLine("Investing the VMotion capability of VM in a Host"); checkVMotionCompatibility(vmname, sourcehost, targethost, targetpool, dataname); } else { migrate_or_relocate_VM(vmname, sourcehost, targethost, targetpool, dataname); } }
private void getVersion(String[] args, VMotion vmotionObj) { String vmname = cb.get_option("vmname"); String sourcehost = cb.get_option("sourcehost"); String targethost = cb.get_option("targethost"); String targetpool = cb.get_option("targetpool"); String dataname = cb.get_option("targetdatastore"); if (cb.option_is_set("validate")) { provisionChkr = cb.getConnection().ServiceContent.vmProvisioningChecker; Console.WriteLine("Investing the VMotion capability of VM in a Host"); checkVMotionCompatibility(vmname, sourcehost, targethost, targetpool, dataname); } else { migrate_or_relocate_VM(vmname, sourcehost, targethost, targetpool, dataname); } }