mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Merge remote-tracking branch 'apache/4.18'
This commit is contained in:
commit
4bdf35b7b0
@ -166,11 +166,11 @@ public class UserVmResponse extends BaseResponseWithTagInformation implements Co
|
||||
private String serviceOfferingName;
|
||||
|
||||
@SerializedName(ApiConstants.DISK_OFFERING_ID)
|
||||
@Param(description = "the ID of the disk offering of the virtual machine", since = "4.4")
|
||||
@Param(description = "the ID of the disk offering of the virtual machine. This parameter should not be used for retrieving disk offering details of DATA volumes. Use listVolumes API instead", since = "4.4")
|
||||
private String diskOfferingId;
|
||||
|
||||
@SerializedName("diskofferingname")
|
||||
@Param(description = "the name of the disk offering of the virtual machine", since = "4.4")
|
||||
@Param(description = "the name of the disk offering of the virtual machine. This parameter should not be used for retrieving disk offering details of DATA volumes. Use listVolumes API instead", since = "4.4")
|
||||
private String diskOfferingName;
|
||||
|
||||
@SerializedName(ApiConstants.BACKUP_OFFERING_ID)
|
||||
|
||||
@ -91,7 +91,7 @@ public class KubernetesClusterUpgradeWorker extends KubernetesClusterActionWorke
|
||||
}
|
||||
try {
|
||||
result = SshHelper.sshExecute(publicIpAddress, sshPort, getControlNodeLoginUser(), sshKeyFile, null,
|
||||
String.format("sudo /opt/bin/kubectl drain %s --ignore-daemonsets --delete-local-data", hostName),
|
||||
String.format("sudo /opt/bin/kubectl drain %s --ignore-daemonsets --delete-emptydir-data", hostName),
|
||||
10000, 10000, 60000);
|
||||
} catch (Exception e) {
|
||||
logTransitStateDetachIsoAndThrow(Level.ERROR, String.format("Failed to upgrade Kubernetes cluster : %s, unable to drain Kubernetes node on VM : %s", kubernetesCluster.getName(), vm.getDisplayName()), kubernetesCluster, clusterVMs, KubernetesCluster.Event.OperationFailed, e);
|
||||
|
||||
@ -137,7 +137,7 @@ if [ -d "$BINARIES_DIR" ]; then
|
||||
|
||||
systemctl stop kubelet
|
||||
cp -a ${BINARIES_DIR}/k8s/{kubelet,kubectl} /opt/bin
|
||||
chmod +x {kubelet,kubectl}
|
||||
chmod +x /opt/bin/{kubelet,kubectl}
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl restart containerd
|
||||
|
||||
@ -28,7 +28,6 @@ import java.util.stream.Collectors;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import com.cloud.vm.VirtualMachine;
|
||||
import org.apache.cloudstack.affinity.AffinityGroupResponse;
|
||||
import org.apache.cloudstack.annotation.AnnotationService;
|
||||
import org.apache.cloudstack.annotation.dao.AnnotationDao;
|
||||
@ -45,6 +44,7 @@ import org.apache.cloudstack.context.CallContext;
|
||||
import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
|
||||
import org.apache.cloudstack.query.QueryService;
|
||||
import org.apache.commons.lang3.BooleanUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@ -62,6 +62,7 @@ import com.cloud.storage.GuestOS;
|
||||
import com.cloud.storage.Storage.TemplateType;
|
||||
import com.cloud.storage.VnfTemplateDetailVO;
|
||||
import com.cloud.storage.VnfTemplateNicVO;
|
||||
import com.cloud.storage.Volume;
|
||||
import com.cloud.storage.dao.VnfTemplateDetailsDao;
|
||||
import com.cloud.storage.dao.VnfTemplateNicDao;
|
||||
import com.cloud.user.Account;
|
||||
@ -77,6 +78,7 @@ import com.cloud.utils.db.SearchCriteria.Op;
|
||||
import com.cloud.utils.net.Dhcp;
|
||||
import com.cloud.vm.UserVmDetailVO;
|
||||
import com.cloud.vm.UserVmManager;
|
||||
import com.cloud.vm.VirtualMachine;
|
||||
import com.cloud.vm.VirtualMachine.State;
|
||||
import com.cloud.vm.VmStats;
|
||||
import com.cloud.vm.dao.NicExtraDhcpOptionDao;
|
||||
@ -591,6 +593,11 @@ public class UserVmJoinDaoImpl extends GenericDaoBaseWithTagInformation<UserVmJo
|
||||
userVmData.addAffinityGroup(resp);
|
||||
}
|
||||
|
||||
if (StringUtils.isEmpty(userVmData.getDiskOfferingId()) && !Volume.Type.ROOT.equals(uvo.getVolumeType())) {
|
||||
userVmData.setDiskOfferingId(uvo.getDiskOfferingUuid());
|
||||
userVmData.setDiskOfferingName(uvo.getDiskOfferingName());
|
||||
}
|
||||
|
||||
return userVmData;
|
||||
}
|
||||
|
||||
|
||||
@ -531,7 +531,7 @@ class TestKubernetesCluster(cloudstackTestCase):
|
||||
@attr(tags=["advanced", "smoke"], required_hardware="true")
|
||||
@skipTestIf("hypervisorNotSupported")
|
||||
def test_07_deploy_kubernetes_ha_cluster(self):
|
||||
"""Test to deploy a new Kubernetes cluster
|
||||
"""Test to deploy a new HA Kubernetes cluster
|
||||
|
||||
# Validate the following:
|
||||
# 1. createKubernetesCluster should return valid info for new cluster
|
||||
@ -542,14 +542,14 @@ class TestKubernetesCluster(cloudstackTestCase):
|
||||
if self.default_network:
|
||||
self.skipTest("HA cluster on shared network requires external ip address, skipping it")
|
||||
global k8s_cluster
|
||||
k8s_cluster = self.getValidKubernetesCluster(1, 2)
|
||||
k8s_cluster = self.getValidKubernetesCluster(1, 3)
|
||||
self.debug("HA Kubernetes cluster with ID: %s successfully deployed" % k8s_cluster.id)
|
||||
return
|
||||
|
||||
@attr(tags=["advanced", "smoke"], required_hardware="true")
|
||||
@skipTestIf("hypervisorNotSupported")
|
||||
def test_08_upgrade_kubernetes_ha_cluster(self):
|
||||
"""Test to upgrade a Kubernetes cluster to newer version
|
||||
"""Test to upgrade a HA Kubernetes cluster to newer version
|
||||
|
||||
# Validate the following:
|
||||
# 1. upgradeKubernetesCluster should return valid info for the cluster
|
||||
@ -559,7 +559,7 @@ class TestKubernetesCluster(cloudstackTestCase):
|
||||
if self.default_network:
|
||||
self.skipTest("HA cluster on shared network requires external ip address, skipping it")
|
||||
global k8s_cluster
|
||||
k8s_cluster = self.getValidKubernetesCluster(1, 2, version=self.kubernetes_version_v1)
|
||||
k8s_cluster = self.getValidKubernetesCluster(1, 3, version=self.kubernetes_version_v1)
|
||||
time.sleep(self.services["sleep"])
|
||||
|
||||
self.debug("Upgrading HA Kubernetes cluster with ID: %s" % k8s_cluster.id)
|
||||
@ -586,7 +586,7 @@ class TestKubernetesCluster(cloudstackTestCase):
|
||||
if self.default_network:
|
||||
self.skipTest("HA cluster on shared network requires external ip address, skipping it")
|
||||
global k8s_cluster
|
||||
k8s_cluster = self.getValidKubernetesCluster(1, 2)
|
||||
k8s_cluster = self.getValidKubernetesCluster(1, 3)
|
||||
|
||||
self.debug("Deleting Kubernetes cluster with ID: %s" % k8s_cluster.id)
|
||||
return
|
||||
|
||||
@ -422,6 +422,7 @@
|
||||
"label.cancel": "Cancel",
|
||||
"label.cancel.shutdown": "Cancel Shutdown",
|
||||
"label.cancelmaintenance": "Cancel maintenance",
|
||||
"label.cancel.host.as.degraded": "Cancel host as degraded",
|
||||
"label.capacity": "Capacity",
|
||||
"label.capacitybytes": "Capacity bytes",
|
||||
"label.capacityiops": "IOPS total",
|
||||
@ -597,6 +598,7 @@
|
||||
"label.db.usage.metrics": "DB/Usage server",
|
||||
"label.dbislocal": "The db runs locally",
|
||||
"label.dc.name": "DC name",
|
||||
"label.declare.host.as.degraded": "Declare host as degraded",
|
||||
"label.decline.invitation": "Decline invitation",
|
||||
"label.dedicate": "Dedicate",
|
||||
"label.dedicate.cluster": "Dedicate cluster",
|
||||
|
||||
@ -295,6 +295,26 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
api: 'declareHostAsDegraded',
|
||||
icon: 'exception-outlined',
|
||||
label: 'label.declare.host.as.degraded',
|
||||
message: 'label.declare.host.as.degraded',
|
||||
dataView: true,
|
||||
show: (record) => {
|
||||
return record.resourcestate !== 'Degraded' && (record.state === 'Alert' || record.state === 'Disconnected')
|
||||
}
|
||||
},
|
||||
{
|
||||
api: 'cancelHostAsDegraded',
|
||||
icon: 'file-done-outlined',
|
||||
label: 'label.cancel.host.as.degraded',
|
||||
message: 'label.cancel.host.as.degraded',
|
||||
dataView: true,
|
||||
show: (record) => {
|
||||
return record.resourcestate === 'Degraded'
|
||||
}
|
||||
},
|
||||
{
|
||||
api: 'deleteHost',
|
||||
icon: 'delete-outlined',
|
||||
|
||||
@ -73,10 +73,12 @@ import {
|
||||
DragOutlined,
|
||||
EditOutlined,
|
||||
EnvironmentOutlined,
|
||||
ExceptionOutlined,
|
||||
ExclamationCircleOutlined,
|
||||
EyeInvisibleOutlined,
|
||||
EyeOutlined,
|
||||
FieldTimeOutlined,
|
||||
FileDoneOutlined,
|
||||
FileProtectOutlined,
|
||||
FilterOutlined,
|
||||
FilterTwoTone,
|
||||
@ -230,10 +232,12 @@ export default {
|
||||
app.component('DragOutlined', DragOutlined)
|
||||
app.component('EditOutlined', EditOutlined)
|
||||
app.component('EnvironmentOutlined', EnvironmentOutlined)
|
||||
app.component('ExceptionOutlined', ExceptionOutlined)
|
||||
app.component('ExclamationCircleOutlined', ExclamationCircleOutlined)
|
||||
app.component('EyeInvisibleOutlined', EyeInvisibleOutlined)
|
||||
app.component('EyeOutlined', EyeOutlined)
|
||||
app.component('FieldTimeOutlined', FieldTimeOutlined)
|
||||
app.component('FileDoneOutlined', FileDoneOutlined)
|
||||
app.component('FileProtectOutlined', FileProtectOutlined)
|
||||
app.component('FilterOutlined', FilterOutlined)
|
||||
app.component('FilterTwoTone', FilterTwoTone)
|
||||
|
||||
@ -278,7 +278,7 @@ export default {
|
||||
initForm () {
|
||||
this.formRef = ref()
|
||||
this.form = reactive({
|
||||
controlnodes: 2,
|
||||
controlnodes: 3,
|
||||
size: 1,
|
||||
noderootdisksize: 8
|
||||
})
|
||||
|
||||
@ -333,7 +333,17 @@ export default {
|
||||
result += columnDelimiter
|
||||
}
|
||||
|
||||
result += typeof item[key] === 'string' && item[key].includes(columnDelimiter) ? `"${item[key]}"` : item[key]
|
||||
if (key === 'tags') {
|
||||
var tags = '"'
|
||||
if (item[key].length > 0) {
|
||||
item[key].forEach(tag => {
|
||||
tags += '(' + tag.key + ',' + tag.value + ')'
|
||||
})
|
||||
}
|
||||
result += tags + '"'
|
||||
} else {
|
||||
result += typeof item[key] === 'string' && item[key].includes(columnDelimiter) ? `"${item[key]}"` : item[key]
|
||||
}
|
||||
ctr++
|
||||
})
|
||||
result += lineDelimiter
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user