Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
// under the License.
package com.cloud.network.element;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -50,6 +51,7 @@
import com.cloud.exception.UnsupportedServiceException;
import com.cloud.host.HostVO;
import com.cloud.host.dao.HostDao;
import com.cloud.host.Status;
import com.cloud.hypervisor.HypervisorGuruManager;
import com.cloud.network.Network;
import com.cloud.network.Network.Capability;
Expand Down Expand Up @@ -573,6 +575,10 @@ private boolean deleteConfigDriveIsoOnHostCache(final VirtualMachine vm, final L
LOG.warn(String.format("Host %s appears to be unavailable, skipping deletion of config-drive ISO on host cache", hostId));
return false;
}
if (!Arrays.asList(Status.Up, Status.Connecting).contains(hostVO.getStatus())) {
LOG.warn(String.format("Host status %s is not Up or Connecting, skipping deletion of config-drive ISO on host cache", hostId));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weizhouapache @vishesh92 Would connecting be included, asking as what if the host isn't up to take the command?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rohityadavcloud This returns false if the status is NOT Up or Connecting..
I matching the checks which are present here: https://github.com/apache/cloudstack/blob/4.18/engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java#L970

return false;
}

final HandleConfigDriveIsoAnswer answer = (HandleConfigDriveIsoAnswer) agentManager.easySend(hostId, configDriveIsoCommand);
if (answer == null) {
Expand Down