Skip to content

bronto merge #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
041b8f6
schema: Added ability to create schemas only when using cloudstack-se…
Spaceman1984 Aug 26, 2021
159c72f
Externalize KVM Agent's option to change migration thread timeout (#4…
GutoVeronezi Aug 26, 2021
8e0e5ac
Externalize VMWare stats time window config (#5357)
SadiJr Aug 26, 2021
b3dca8c
ui: Go back for delete actions before querying async job (#5360)
davidjumani Aug 27, 2021
f957457
Merge remote-tracking branch 'apache/4.15' into main
davidjumani Aug 27, 2021
442f89c
ui: Fix search with same parameters (#5367)
davidjumani Aug 27, 2021
7f3bb94
Merge remote-tracking branch 'origin/4.15' into main
rohityadavcloud Aug 27, 2021
7f4f3f7
[VMware DRS] Adding new host to DRS cluster does not participate in l…
sureshanaparti Aug 27, 2021
e968f3b
server: detach data disks before destroying vms (#5356)
weizhouapache Aug 28, 2021
8860fc8
Merge branch '4.15' into main
nvazquez Aug 28, 2021
4acedc8
Fix failure to scp diagnostic data file from SSVM on ubuntu based env…
Pearl1594 Aug 28, 2021
1d3083d
Added support for removing unused port groups on VMWare (#4701)
Spaceman1984 Aug 28, 2021
41f6f0e
server: allow destroy/recover volumes which are attached to removed v…
weizhouapache Aug 28, 2021
04738d7
Merge branch '4.15' into main
nvazquez Aug 28, 2021
d8a961e
Fix action bar in place (#5368)
davidjumani Aug 30, 2021
46ca853
Added Worker VM tags for few cloned VMs, created while performing som…
sureshanaparti Aug 30, 2021
e50a40e
Start VM with deploy-as-is template having multiple disk (SCSI) contr…
sureshanaparti Aug 31, 2021
fc213ac
server: improve attach volume in specific cases (#5371)
shwstppr Aug 31, 2021
3ddcf85
Merge branch '4.15' into main
nvazquez Aug 31, 2021
da1384f
Merge branch 'main' into ablestack-bronto
dhslove Aug 31, 2021
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
3 changes: 3 additions & 0 deletions agent/conf/agent.properties
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,9 @@ iscsi.session.cleanup.enabled=false
# Depending on the use case, this timeout might need increasing/decreasing.
# heartbeat.update.timeout=60000

# This parameter specifies the timeout in seconds to retrieve the target's domain id when migrating a VM with KVM.
# vm.migrate.domain.retrieve.timeout=10

# This parameter specifies if the host must be rebooted when something goes wrong with the heartbeat.
# reboot.host.and.alert.management.on.heartbeat.timeout=true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,16 @@ public class AgentProperties{
* Heartbeat update timeout. <br>
* Data type: int. <br>
* Default value: 60000 (ms).
*/
*/
public static final Property<Integer> HEARTBEAT_UPDATE_TIMEOUT = new Property<Integer>("heartbeat.update.timeout", 60000);

/**
* The timeout in seconds to retrieve the target's domain id when migrating a VM with KVM. <br>
* Data type: int. <br>
* Default value: 10 (sec).
*/
public static final Property<Integer> VM_MIGRATE_DOMAIN_RETRIEVE_TIMEOUT = new Property<Integer>("vm.migrate.domain.retrieve.timeout", 10);

/**
* Reboot host and alert management on heartbeat timeout. <br>
* Data type: boolean.<br>
Expand Down
2 changes: 2 additions & 0 deletions engine/schema/src/main/java/com/cloud/host/dao/HostDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ public interface HostDao extends GenericDao<HostVO, Long>, StateDao<Status, Stat

List<HostVO> findHypervisorHostInCluster(long clusterId);

HostVO findOldestExistentHypervisorHostInCluster(long clusterId);

List<HostVO> listAllUpAndEnabledNonHAHosts(Type type, Long clusterId, Long podId, long dcId, String haTag);

List<HostVO> findByDataCenterId(Long zoneId);
Expand Down
17 changes: 17 additions & 0 deletions engine/schema/src/main/java/com/cloud/host/dao/HostDaoImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,23 @@ public List<HostVO> findHypervisorHostInCluster(long clusterId) {
return listBy(sc);
}

@Override
public HostVO findOldestExistentHypervisorHostInCluster(long clusterId) {
SearchCriteria<HostVO> sc = TypeClusterStatusSearch.create();
sc.setParameters("type", Host.Type.Routing);
sc.setParameters("cluster", clusterId);
sc.setParameters("status", Status.Up);
sc.setParameters("resourceState", ResourceState.Enabled);
Filter orderByFilter = new Filter(HostVO.class, "created", true, null, null);

List<HostVO> hosts = search(sc, orderByFilter, null, false);
if (hosts != null && hosts.size() > 0) {
return hosts.get(0);
}

return null;
}

@Override
public List<Long> listAllHosts(long zoneId) {
SearchCriteria<Long> sc = HostIdSearch.create();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
import com.cloud.agent.api.MigrateCommand;
import com.cloud.agent.api.MigrateCommand.MigrateDiskInfo;
import com.cloud.agent.api.to.VirtualMachineTO;
import com.cloud.agent.properties.AgentProperties;
import com.cloud.agent.properties.AgentPropertiesFileHandler;
import com.cloud.hypervisor.kvm.resource.LibvirtComputingResource;
import com.cloud.hypervisor.kvm.resource.LibvirtConnection;
import com.cloud.hypervisor.kvm.resource.LibvirtVMDef.DiskDef;
Expand Down Expand Up @@ -239,7 +241,7 @@ Use VIR_DOMAIN_XML_SECURE (value = 1) prior to v1.0.0.
}
s_logger.info("Migration thread for " + vmName + " is done");

destDomain = migrateThread.get(10, TimeUnit.SECONDS);
destDomain = migrateThread.get(AgentPropertiesFileHandler.getPropertyValue(AgentProperties.VM_MIGRATE_DOMAIN_RETRIEVE_TIMEOUT), TimeUnit.SECONDS);

if (destDomain != null) {
deleteOrDisconnectDisksOnSourcePool(libvirtComputingResource, migrateDiskInfoList, disks);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ public interface VmwareManager {
static final ConfigKey<Integer> s_vmwareOVAPackageTimeout = new ConfigKey<Integer>(Integer.class, "vmware.package.ova.timeout", "Advanced", "3600",
"Vmware script timeout for ova packaging process", true, ConfigKey.Scope.Global, 1000);

static final ConfigKey<Boolean> s_vmwareCleanupPortGroups = new ConfigKey<Boolean>("Advanced", Boolean.class, "vmware.cleanup.port.groups", "false",
"When set to true, the unused port groups are removed from VMware hypervisor hosts. WARNING: Native VMware HA might not work when enabled.", true, ConfigKey.Scope.Global);

public static final ConfigKey<Integer> VMWARE_STATS_TIME_WINDOW = new ConfigKey<Integer>("Advanced", Integer.class, "vmware.stats.time.window", "300",
"VMware interval window (in seconds) to collect metrics. If this is set to less than 20, then default (300 seconds) will be used. The interval used must be enabled in vCenter for this change to work, "
+ "otherwise the collection of metrics will result in an error. Check VMWare docs to know how to enable metrics interval.", true);

String composeWorkerName();

String getSystemVMIsoFileNameOnDatastore();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import com.cloud.exception.OperationTimedoutException;
import com.cloud.exception.ResourceInUseException;
import com.cloud.host.Host;
import com.cloud.host.HostVO;
import com.cloud.host.Status;
import com.cloud.host.dao.HostDao;
import com.cloud.host.dao.HostDetailsDao;
Expand Down Expand Up @@ -100,6 +101,7 @@
import com.cloud.utils.FileUtil;
import com.cloud.utils.NumbersUtil;
import com.cloud.utils.Pair;
import com.cloud.utils.UriUtils;
import com.cloud.utils.component.ManagerBase;
import com.cloud.utils.concurrency.NamedThreadFactory;
import com.cloud.utils.db.DB;
Expand Down Expand Up @@ -136,6 +138,8 @@
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
import org.apache.cloudstack.utils.identity.ManagementServerNode;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;

import javax.inject.Inject;
Expand All @@ -145,6 +149,7 @@
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLDecoder;
import java.rmi.RemoteException;
import java.time.Duration;
import java.time.Instant;
Expand Down Expand Up @@ -270,7 +275,7 @@ public String getConfigComponentName() {

@Override
public ConfigKey<?>[] getConfigKeys() {
return new ConfigKey<?>[] {s_vmwareNicHotplugWaitTimeout, s_vmwareCleanOldWorderVMs, templateCleanupInterval, s_vmwareSearchExcludeFolder, s_vmwareOVAPackageTimeout};
return new ConfigKey<?>[] {s_vmwareNicHotplugWaitTimeout, s_vmwareCleanOldWorderVMs, templateCleanupInterval, s_vmwareSearchExcludeFolder, s_vmwareOVAPackageTimeout, s_vmwareCleanupPortGroups, VMWARE_STATS_TIME_WINDOW};
}
@Override
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
Expand Down Expand Up @@ -446,6 +451,29 @@ private void prepareHost(HostMO hostMo, String privateTrafficLabel) throws Excep
}
}

private HostMO getOldestExistentHostInCluster(Long clusterId, VmwareContext serviceContext) throws Exception {
HostVO host = hostDao.findOldestExistentHypervisorHostInCluster(clusterId);
if (host == null) {
return null;
}

ManagedObjectReference morSrcHost = HypervisorHostHelper.getHypervisorHostMorFromGuid(host.getGuid());
if (morSrcHost == null) {
Map<String, String> clusterDetails = clusterDetailsDao.findDetails(clusterId);
if (MapUtils.isEmpty(clusterDetails) || StringUtils.isBlank(clusterDetails.get("url"))) {
return null;
}

URI uriForHost = new URI(UriUtils.encodeURIComponent(clusterDetails.get("url") + "/" + host.getName()));
morSrcHost = serviceContext.getHostMorByPath(URLDecoder.decode(uriForHost.getPath(), "UTF-8"));
if (morSrcHost == null) {
return null;
}
}

return new HostMO(serviceContext, morSrcHost);
}

@Override
public List<ManagedObjectReference> addHostToPodCluster(VmwareContext serviceContext, long dcId, Long podId, Long clusterId, String hostInventoryPath)
throws Exception {
Expand Down Expand Up @@ -498,6 +526,11 @@ public List<ManagedObjectReference> addHostToPodCluster(VmwareContext serviceCon
// For ESX host, we need to enable host firewall to allow VNC access
HostMO hostMo = new HostMO(serviceContext, mor);
prepareHost(hostMo, privateTrafficLabel);
HostMO olderHostMo = getOldestExistentHostInCluster(clusterId, serviceContext);
if (olderHostMo != null) {
hostMo.copyPortGroupsFromHost(olderHostMo);
}

returnedHostList.add(mor);
return returnedHostList;
} else {
Expand Down
Loading