File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource
server/src/main/java/org/apache/cloudstack/ingestion Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -6801,7 +6801,9 @@ private Answer execute(GetUnmanagedInstancesCommand cmd) {
68016801
68026802 if (vmMos != null && !vmMos .isEmpty ()) {
68036803 for (VirtualMachineMO vmMo : vmMos ) {
6804- if (vmMo != null && !vmMo .isTemplate () && !cmd .hasManagedInstance (vmMo .getName ())) {
6804+ if (vmMo != null && !vmMo .isTemplate () && !cmd .hasManagedInstance (vmMo .getName ()) &&
6805+ (Strings .isNullOrEmpty (cmd .getInstanceName ()) || (!Strings .isNullOrEmpty (cmd .getInstanceName ()) &&
6806+ cmd .getInstanceName ().equals (vmMo .getVmName ())))) {
68056807 UnmanagedInstance instance = new UnmanagedInstance ();
68066808 instance .setName (vmMo .getVmName ());
68076809 instance .setCpuCores (vmMo .getConfigSummary ().getNumCpu ());
Original file line number Diff line number Diff line change @@ -373,8 +373,8 @@ public UserVmResponse importUnmanagedInstance(ImportUnmanageInstanceCmd cmd) {
373373 } catch (Exception e ) {
374374 LOGGER .warn (String .format ("Unable to retrieve virtual router vms for host ID: %s" , host .getUuid ()));
375375 }
376- GetUnmanagedInstancesCommand command = new GetUnmanagedInstancesCommand ();
377- command .setInstanceName ( instanceName );
376+ GetUnmanagedInstancesCommand command = new GetUnmanagedInstancesCommand (instanceName );
377+ command .setManagedInstancesNames ( managedVms );
378378 Answer answer = agentManager .easySend (host .getId (), command );
379379 if (answer instanceof GetUnmanagedInstancesAnswer ) {
380380 GetUnmanagedInstancesAnswer unmanagedInstancesAnswer = (GetUnmanagedInstancesAnswer ) answer ;
You can’t perform that action at this time.
0 commit comments