Skip to content

Commit d673742

Browse files
committed
Merge remote-tracking branch 'upstream/main' into ExternalDeploymentIntegration
2 parents c25bf9d + 217ff27 commit d673742

11 files changed

Lines changed: 45 additions & 29 deletions

File tree

engine/schema/src/main/java/com/cloud/capacity/dao/CapacityDaoImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,9 @@ public class CapacityDaoImpl extends GenericDaoBase<CapacityVO, Long> implements
204204
"(CASE WHEN ISNULL(service_offering.speed) THEN custom_speed.value ELSE service_offering.speed end) AS speed, " +
205205
"(CASE WHEN ISNULL(service_offering.ram_size) THEN custom_ram_size.value ELSE service_offering.ram_size end) AS ram_size " +
206206
"FROM vm_instance vi LEFT JOIN service_offering ON(((vi.service_offering_id = service_offering.id))) " +
207-
"LEFT JOIN user_vm_details custom_cpu ON(((custom_cpu.vm_id = vi.id) AND (custom_cpu.name = 'CpuNumber'))) " +
208-
"LEFT JOIN user_vm_details custom_speed ON(((custom_speed.vm_id = vi.id) AND (custom_speed.name = 'CpuSpeed'))) " +
209-
"LEFT JOIN user_vm_details custom_ram_size ON(((custom_ram_size.vm_id = vi.id) AND (custom_ram_size.name = 'memory'))) ";
207+
"LEFT JOIN vm_instance_details custom_cpu ON(((custom_cpu.vm_id = vi.id) AND (custom_cpu.name = 'CpuNumber'))) " +
208+
"LEFT JOIN vm_instance_details custom_speed ON(((custom_speed.vm_id = vi.id) AND (custom_speed.name = 'CpuSpeed'))) " +
209+
"LEFT JOIN vm_instance_details custom_ram_size ON(((custom_ram_size.vm_id = vi.id) AND (custom_ram_size.name = 'memory'))) ";
210210

211211
private static final String WHERE_STATE_IS_NOT_DESTRUCTIVE =
212212
"WHERE ISNULL(vi.removed) AND vi.state NOT IN ('Destroyed', 'Error', 'Expunging')";

engine/schema/src/main/java/com/cloud/configuration/dao/ResourceCountDaoImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ public long removeEntriesByOwner(long ownerId, ResourceOwnerType ownerType) {
336336
+ " END)) as total "
337337
+ " from vm_instance vm "
338338
+ " join service_offering so on so.id = vm.service_offering_id "
339-
+ " left join user_vm_details vmd on vmd.vm_id = vm.id and vmd.name = '%s' "
339+
+ " left join vm_instance_details vmd on vmd.vm_id = vm.id and vmd.name = '%s' "
340340
+ " where vm.type = 'User' and state not in ('Destroyed', 'Error', 'Expunging') and display_vm = true and account_id = ? ";
341341

342342
@Override

engine/schema/src/main/java/com/cloud/vm/dao/UserVmDaoImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ public class UserVmDaoImpl extends GenericDaoBase<UserVmVO, Long> implements Use
124124
+ "left join security_group on security_group_vm_map.security_group_id=security_group.id " + "left join nics on vm_instance.id=nics.instance_id "
125125
+ "left join networks on nics.network_id=networks.id " + "left join user_ip_address on user_ip_address.vm_id=vm_instance.id " + "where vm_instance.id in (";
126126

127-
private static final String VMS_DETAIL_BY_NAME = "select vm_instance.instance_name, vm_instance.vm_type, vm_instance.id , user_vm_details.value, user_vm_details.name from vm_instance "
128-
+ "left join user_vm_details on vm_instance.id = user_vm_details.vm_id where (user_vm_details.name is null or user_vm_details.name = ? ) and vm_instance.instance_name in (";
127+
private static final String VMS_DETAIL_BY_NAME = "select vm_instance.instance_name, vm_instance.vm_type, vm_instance.id , vm_instance_details.value, vm_instance_details.name from vm_instance "
128+
+ "left join vm_instance_details on vm_instance.id = vm_instance_details.vm_id where (vm_instance_details.name is null or vm_instance_details.name = ? ) and vm_instance.instance_name in (";
129129

130130
private static final int VM_DETAILS_BATCH_SIZE = 100;
131131

@@ -755,7 +755,7 @@ public List<Pair<Pair<String, VirtualMachine.Type>, Pair<Long, String>>> getVmsD
755755
while (rs.next()) {
756756
vmsDetailByNames.add(new Pair<Pair<String, VirtualMachine.Type>, Pair<Long, String>>(new Pair<String, VirtualMachine.Type>(
757757
rs.getString("vm_instance.instance_name"), VirtualMachine.Type.valueOf(rs.getString("vm_type"))),
758-
new Pair<Long, String>(rs.getLong("vm_instance.id"), rs.getString("user_vm_details.value"))));
758+
new Pair<Long, String>(rs.getLong("vm_instance.id"), rs.getString("vm_instance_details.value"))));
759759
}
760760
}
761761
} catch (SQLException e) {

framework/db/src/main/java/com/cloud/utils/crypt/EncryptionSecretKeyChanger.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ private void migrateScaleIOStoragePoolDetails(Connection conn) {
632632

633633
private void migrateUserVmDetails(Connection conn) {
634634
System.out.println("Begin migrate user vm details");
635-
migrateDetails(conn, "user_vm_details", PASSWORD);
635+
migrateDetails(conn, "vm_instance_details", PASSWORD);
636636
System.out.println("End migrate user vm details");
637637
}
638638

plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3203,7 +3203,7 @@ protected void setNewVRamSizeVmVideoCard(VirtualMachineMO vmMo, long svgaVmramSi
32033203
}
32043204

32053205
/**
3206-
* Modifies vm vram size if it was set to a different size to the one provided in svga.vramSize (user_vm_details or template_vm_details) on {@code vmConfigSpec}
3206+
* Modifies vm vram size if it was set to a different size to the one provided in svga.vramSize (vm_instance_details or template_vm_details) on {@code vmConfigSpec}
32073207
*
32083208
* @param videoCard vm's video card device
32093209
* @param vmMo virtual machine mo

scripts/util/create-kubernetes-binaries-iso.sh

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,41 +19,56 @@
1919
set -e
2020

2121
if [ $# -lt 6 ]; then
22-
echo "Invalid input. Valid usage: ./create-kubernetes-binaries-iso.sh OUTPUT_PATH KUBERNETES_VERSION CNI_VERSION CRICTL_VERSION WEAVENET_NETWORK_YAML_CONFIG DASHBOARD_YAML_CONFIG BUILD_NAME [ETCD_VERSION]"
23-
echo "eg: ./create-kubernetes-binaries-iso.sh ./ 1.11.4 0.7.1 1.11.1 https://github.com/weaveworks/weave/releases/download/latest_release/weave-daemonset-k8s-1.11.yaml https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.0/src/deploy/recommended/kubernetes-dashboard.yaml setup-v1.11.4 3.5.1"
22+
echo "Invalid input. Valid usage: ./create-kubernetes-binaries-iso.sh OUTPUT_PATH KUBERNETES_VERSION CNI_VERSION CRICTL_VERSION WEAVENET_NETWORK_YAML_CONFIG DASHBOARD_YAML_CONFIG BUILD_NAME [ARCH] [ETCD_VERSION]"
23+
echo "eg: ./create-kubernetes-binaries-iso.sh ./ 1.11.4 0.7.1 1.11.1 https://github.com/weaveworks/weave/releases/download/latest_release/weave-daemonset-k8s-1.11.yaml https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.0/src/deploy/recommended/kubernetes-dashboard.yaml setup-v1.11.4 amd64"
2424
exit 1
2525
fi
2626

27+
ARCH="amd64"
28+
ARCH_SUFFIX="x86_64"
29+
if [ -n "${8}" ]; then
30+
if [ "${8}" = "x86_64" ] || [ "${8}" = "amd64" ]; then
31+
ARCH="amd64"
32+
ARCH_SUFFIX="x86_64"
33+
elif [ "${8}" = "aarch64" ] || [ "${8}" = "arm64" ]; then
34+
ARCH="arm64"
35+
ARCH_SUFFIX="aarch64"
36+
else
37+
echo "ERROR: ARCH must be 'x86_64' or 'aarch64'. If the optional parameter ARCH is not set then 'x86_64' is used."
38+
exit 1
39+
fi
40+
fi
41+
2742
RELEASE="v${2}"
2843
VAL="1.18.0"
2944
output_dir="${1}"
3045
start_dir="$PWD"
3146
iso_dir="/tmp/iso"
3247
working_dir="${iso_dir}/"
3348
mkdir -p "${working_dir}"
34-
build_name="${7}.iso"
35-
[ -z "${build_name}" ] && build_name="setup-${RELEASE}.iso"
49+
build_name="${7}-${ARCH_SUFFIX}.iso"
50+
[ -z "${build_name}" ] && build_name="setup-${RELEASE}-${ARCH_SUFFIX}.iso"
3651

3752
CNI_VERSION="v${3}"
3853
echo "Downloading CNI ${CNI_VERSION}..."
3954
cni_dir="${working_dir}/cni/"
4055
mkdir -p "${cni_dir}"
41-
cni_status_code=$(curl -L --write-out "%{http_code}\n" "https://github.com/containernetworking/plugins/releases/download/${CNI_VERSION}/cni-plugins-linux-amd64-${CNI_VERSION}.tgz" -o "${cni_dir}/cni-plugins-amd64.tgz")
56+
cni_status_code=$(curl -L --write-out "%{http_code}\n" "https://github.com/containernetworking/plugins/releases/download/${CNI_VERSION}/cni-plugins-linux-${ARCH}-${CNI_VERSION}.tgz" -o "${cni_dir}/cni-plugins-${ARCH}.tgz")
4257
if [[ ${cni_status_code} -eq 404 ]] ; then
43-
curl -L --write-out "%{http_code}\n" "https://github.com/containernetworking/plugins/releases/download/${CNI_VERSION}/cni-plugins-amd64-${CNI_VERSION}.tgz" -o "${cni_dir}/cni-plugins-amd64.tgz"
58+
curl -L --write-out "%{http_code}\n" "https://github.com/containernetworking/plugins/releases/download/${CNI_VERSION}/cni-plugins-${ARCH}-${CNI_VERSION}.tgz" -o "${cni_dir}/cni-plugins-${ARCH}.tgz"
4459
fi
4560

4661
CRICTL_VERSION="v${4}"
4762
echo "Downloading CRI tools ${CRICTL_VERSION}..."
4863
crictl_dir="${working_dir}/cri-tools/"
4964
mkdir -p "${crictl_dir}"
50-
curl -L "https://github.com/kubernetes-incubator/cri-tools/releases/download/${CRICTL_VERSION}/crictl-${CRICTL_VERSION}-linux-amd64.tar.gz" -o "${crictl_dir}/crictl-linux-amd64.tar.gz"
65+
curl -L "https://github.com/kubernetes-incubator/cri-tools/releases/download/${CRICTL_VERSION}/crictl-${CRICTL_VERSION}-linux-${ARCH}.tar.gz" -o "${crictl_dir}/crictl-linux-${ARCH}.tar.gz"
5166

5267
echo "Downloading Kubernetes tools ${RELEASE}..."
5368
k8s_dir="${working_dir}/k8s"
5469
mkdir -p "${k8s_dir}"
5570
cd "${k8s_dir}"
56-
curl -L --remote-name-all https://dl.k8s.io/release/${RELEASE}/bin/linux/amd64/{kubeadm,kubelet,kubectl}
71+
curl -L --remote-name-all https://dl.k8s.io/release/${RELEASE}/bin/linux/${ARCH}/{kubeadm,kubelet,kubectl}
5772
kubeadm_file_permissions=`stat --format '%a' kubeadm`
5873
chmod +x kubeadm
5974

@@ -148,11 +163,12 @@ chmod ${kubeadm_file_permissions} "${working_dir}/k8s/kubeadm"
148163
echo "Updating imagePullPolicy to IfNotPresent in yaml files..."
149164
sed -i "s/imagePullPolicy:.*/imagePullPolicy: IfNotPresent/g" ${working_dir}/*.yaml
150165

151-
if [ -n "${8}" ]; then
166+
# Optional parameter ETCD_VERSION
167+
if [ -n "${9}" ]; then
152168
# Install etcd dependencies
153169
etcd_dir="${working_dir}/etcd"
154170
mkdir -p "${etcd_dir}"
155-
ETCD_VERSION=v${8}
171+
ETCD_VERSION=v${9}
156172
wget -q --show-progress "https://github.com/etcd-io/etcd/releases/download/${ETCD_VERSION}/etcd-${ETCD_VERSION}-linux-amd64.tar.gz" -O ${etcd_dir}/etcd-linux-amd64.tar.gz
157173
fi
158174

server/src/main/java/com/cloud/vm/UserVmManagerImpl.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6343,7 +6343,7 @@ public UserVm createVirtualMachine(DeployVMCmd cmd) throws InsufficientCapacityE
63436343
}
63446344
}
63456345

6346-
// Add extraConfig to user_vm_details table
6346+
// Add extraConfig to vm_instance_details table
63476347
String extraConfig = cmd.getExtraConfig();
63486348
if (StringUtils.isNotBlank(extraConfig)) {
63496349
if (EnableAdditionalVmConfig.valueIn(callerId)) {
@@ -6501,7 +6501,7 @@ private void checkIfVolumeTemplateIsTheSameAsTheProvided(VolumeInfo volume, Long
65016501
}
65026502

65036503
/**
6504-
* Persist extra configuration data in the user_vm_details table as key/value pair
6504+
* Persist extra configuration data in the vm_instance_details table as key/value pair
65056505
* @param decodedUrl String consisting of the extra config data to appended onto the vmx file for VMware instances
65066506
*/
65076507
protected void persistExtraConfigVmware(String decodedUrl, UserVm vm) {
@@ -6525,7 +6525,7 @@ protected void persistExtraConfigVmware(String decodedUrl, UserVm vm) {
65256525
}
65266526

65276527
/**
6528-
* Used to persist extra configuration settings in user_vm_details table for the XenServer hypervisor
6528+
* Used to persist extra configuration settings in vm_instance_details table for the XenServer hypervisor
65296529
* persists config as key/value pair e.g key = extraconfig-1 , value="PV-bootloader=pygrub" and so on to extraconfig-N where
65306530
* N denotes the number of extra configuration settings passed by user
65316531
*
@@ -6606,9 +6606,9 @@ protected boolean isValidXenOrVmwareConfiguration(String cfg, String[] allowedKe
66066606

66076607
/**
66086608
* Persist extra configuration data on KVM
6609-
* persisted in the user_vm_details DB as extraconfig-1, and so on depending on the number of configurations
6609+
* persisted in the vm_instance_details DB as extraconfig-1, and so on depending on the number of configurations
66106610
* For KVM, extra config is passed as XML
6611-
* @param decodedUrl string containing xml configuration to be persisted into user_vm_details table
6611+
* @param decodedUrl string containing xml configuration to be persisted into vm_instance_details table
66126612
* @param vm
66136613
*/
66146614
protected void persistExtraConfigKvm(String decodedUrl, UserVm vm) {

test/integration/component/test_rootvolume_resize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def getDiskController(self, vm, diskcontroller="ide"):
308308
vmid = int(qresultvmuuid[0][0])
309309
qresult = self.dbclient.execute(
310310
"select rootDiskController from"
311-
" user_vm_details where id = '%s';" % vmid
311+
" vm_instance_details where id = '%s';" % vmid
312312
)
313313
self.debug("Query result: %s" % qresult)
314314
diskcontroller = qresult[0][0]

test/integration/component/test_update_vm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def test_update_vm_details_admin(self):
186186
vm_db_id = dbresult[0][0]
187187
self.debug("VM has database id %d" % vm_db_id)
188188

189-
self.dbclient.execute("insert into user_vm_details (vm_id, name, value, display) values (%d,'%s','HOST', 0)" % (vm_db_id, hidden_detail_name))
189+
self.dbclient.execute("insert into vm_instance_details (vm_id, name, value, display) values (%d,'%s','HOST', 0)" % (vm_db_id, hidden_detail_name))
190190

191191
vm = self.listVmById(self.virtual_machine.id)
192192
self.debug("VirtualMachine fetched with details: %s of type %s" % (vm.details, type(vm.details)))
@@ -227,7 +227,7 @@ def test_update_vm_details_admin(self):
227227

228228

229229
def detailInDatabase(self, vm_id, detail_name):
230-
dbresult = self.dbclient.execute("select id from user_vm_details where vm_id=%s and name='%s'" % (vm_id, detail_name))
230+
dbresult = self.dbclient.execute("select id from vm_instance_details where vm_id=%s and name='%s'" % (vm_id, detail_name))
231231
self.debug("Detail %s for VM %s: %s" % (detail_name, vm_id, dbresult))
232232
if validateList(dbresult)[0] == PASS:
233233
return True

test/integration/smoke/test_deploy_vgpu_enabled_vm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ def test_3d_gpu_support(self):
319319

320320
qresultset = self.dbclient.execute("select id from vm_instance where uuid = '%s';" % self.virtual_machine.id)
321321
vm_id = qresultset[0]
322-
qresultset = self.dbclient.execute("select name, value from user_vm_details where vm_id = '%d';" % vm_id)
322+
qresultset = self.dbclient.execute("select name, value from vm_instance_details where vm_id = '%d';" % vm_id)
323323
detailKeys = [x[0] for x in qresultset]
324324

325325
self.assertTrue('mks.enable3d' in detailKeys and 'mks.use3dRenderer' in detailKeys and 'svga.autodetect' in detailKeys and 'svga.vramSize' in detailKeys, "VM details do not contain 3D GPU details")

0 commit comments

Comments
 (0)