Skip to content

Commit 317ecbb

Browse files
author
Sina Kashipazha
committed
Merge branch 'apache-main' into 4.15-lbconfigs
2 parents 4125854 + 444d37a commit 317ecbb

File tree

35 files changed

+374
-246
lines changed

35 files changed

+374
-246
lines changed

api/src/main/java/org/apache/cloudstack/api/command/user/firewall/CreateFirewallRuleCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public class CreateFirewallRuleCmd extends BaseAsyncCreateCmd implements Firewal
7373
@Parameter(name = ApiConstants.END_PORT, type = CommandType.INTEGER, description = "the ending port of firewall rule")
7474
private Integer publicEndPort;
7575

76-
@Parameter(name = ApiConstants.CIDR_LIST, type = CommandType.LIST, collectionType = CommandType.STRING, description = "the CIDR list to forward traffic from. Multiple entries must be separated by a single comma character (,).")
76+
@Parameter(name = ApiConstants.CIDR_LIST, type = CommandType.LIST, collectionType = CommandType.STRING, description = "the CIDR list to forward traffic from. Multiple entries must be separated by a single comma character (,). This parameter is deprecated. Do not use.")
7777
private List<String> cidrlist;
7878

7979
@Parameter(name = ApiConstants.ICMP_TYPE, type = CommandType.INTEGER, description = "type of the ICMP message being sent")

api/src/main/java/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P
108108
description = "the ID of the virtual machine for the port forwarding rule")
109109
private Long virtualMachineId;
110110

111-
@Parameter(name = ApiConstants.CIDR_LIST, type = CommandType.LIST, collectionType = CommandType.STRING, description = "the cidr list to forward traffic from. Multiple entries must be separated by a single comma character (,).")
111+
@Parameter(name = ApiConstants.CIDR_LIST, type = CommandType.LIST, collectionType = CommandType.STRING, description = "the cidr list to forward traffic from. Multiple entries must be separated by a single comma character (,). This parameter is deprecated. Do not use.")
112112
private List<String> cidrlist;
113113

114114
@Parameter(name = ApiConstants.OPEN_FIREWALL, type = CommandType.BOOLEAN, description = "if true, firewall rule for source/end public port is automatically created; "

debian/cloudstack-management.postinst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ if [ "$1" = configure ]; then
6363
grep -s -q "db.cloud.driver=jdbc:mysql" ${CONFDIR}/${DBPROPS} || sed -i -e "\$adb.cloud.driver=jdbc:mysql" ${CONFDIR}/${DBPROPS}
6464
grep -s -q "db.usage.driver=jdbc:mysql" ${CONFDIR}/${DBPROPS} || sed -i -e "\$adb.usage.driver=jdbc:mysql" ${CONFDIR}/${DBPROPS}
6565
grep -s -q "db.simulator.driver=jdbc:mysql" ${CONFDIR}/${DBPROPS} || sed -i -e "\$adb.simulator.driver=jdbc:mysql" ${CONFDIR}/${DBPROPS}
66+
67+
# Update DB properties having master and slave(s), with source and replica(s) respectively (for inclusiveness)
68+
grep -s -q "^db.cloud.slaves=" ${CONFDIR}/${DBPROPS} && sed -i "s/^db.cloud.slaves=/db.cloud.replicas=/g" ${CONFDIR}/${DBPROPS}
69+
grep -s -q "^db.cloud.secondsBeforeRetryMaster=" ${CONFDIR}/${DBPROPS} && sed -i "s/^db.cloud.secondsBeforeRetryMaster=/db.cloud.secondsBeforeRetrySource=/g" ${CONFDIR}/${DBPROPS}
70+
grep -s -q "^db.cloud.queriesBeforeRetryMaster=" ${CONFDIR}/${DBPROPS} && sed -i "s/^db.cloud.queriesBeforeRetryMaster=/db.cloud.queriesBeforeRetrySource=/g" ${CONFDIR}/${DBPROPS}
71+
grep -s -q "^db.usage.slaves=" ${CONFDIR}/${DBPROPS} && sed -i "s/^db.usage.slaves=/db.usage.replicas=/g" ${CONFDIR}/${DBPROPS}
72+
grep -s -q "^db.usage.secondsBeforeRetryMaster=" ${CONFDIR}/${DBPROPS} && sed -i "s/^db.usage.secondsBeforeRetryMaster=/db.usage.secondsBeforeRetrySource=/g" ${CONFDIR}/${DBPROPS}
73+
grep -s -q "^db.usage.queriesBeforeRetryMaster=" ${CONFDIR}/${DBPROPS} && sed -i "s/^db.usage.queriesBeforeRetryMaster=/db.usage.queriesBeforeRetrySource=/g" ${CONFDIR}/${DBPROPS}
6674
fi
6775

6876
#DEBHELPER#

engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -881,8 +881,9 @@ public Ternary<VMInstanceVO, ReservationContext, ItWorkVO> doInTransaction(final
881881
}
882882

883883
if (state != State.Stopped) {
884-
s_logger.debug("VM " + vm + " is not in a state to be started: " + state);
885-
return null;
884+
String msg = String.format("Cannot start %s in %s state", vm, state);
885+
s_logger.warn(msg);
886+
throw new CloudRuntimeException(msg);
886887
}
887888
}
888889

engine/schema/src/main/resources/META-INF/db/schema-41510to41600.sql

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,3 +441,95 @@ CREATE TABLE IF NOT EXISTS `cloud`.`load_balancer_config` (
441441
CONSTRAINT `fk_load_balancer_config_vpc_id` FOREIGN KEY (`vpc_id`) REFERENCES `vpc` (`id`) ON DELETE CASCADE,
442442
CONSTRAINT `fk_load_balancer_config_loadbalancer_id` FOREIGN KEY (`load_balancer_id`) REFERENCES `load_balancing_rules` (`id`) ON DELETE CASCADE
443443
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
444+
445+
-- Re-create host view to prevent multiple entries for hosts with multiple tags
446+
DROP VIEW IF EXISTS `cloud`.`host_view`;
447+
CREATE VIEW `cloud`.`host_view` AS
448+
SELECT
449+
host.id,
450+
host.uuid,
451+
host.name,
452+
host.status,
453+
host.disconnected,
454+
host.type,
455+
host.private_ip_address,
456+
host.version,
457+
host.hypervisor_type,
458+
host.hypervisor_version,
459+
host.capabilities,
460+
host.last_ping,
461+
host.created,
462+
host.removed,
463+
host.resource_state,
464+
host.mgmt_server_id,
465+
host.cpu_sockets,
466+
host.cpus,
467+
host.speed,
468+
host.ram,
469+
cluster.id cluster_id,
470+
cluster.uuid cluster_uuid,
471+
cluster.name cluster_name,
472+
cluster.cluster_type,
473+
data_center.id data_center_id,
474+
data_center.uuid data_center_uuid,
475+
data_center.name data_center_name,
476+
data_center.networktype data_center_type,
477+
host_pod_ref.id pod_id,
478+
host_pod_ref.uuid pod_uuid,
479+
host_pod_ref.name pod_name,
480+
GROUP_CONCAT(DISTINCT(host_tags.tag)) AS tag,
481+
guest_os_category.id guest_os_category_id,
482+
guest_os_category.uuid guest_os_category_uuid,
483+
guest_os_category.name guest_os_category_name,
484+
mem_caps.used_capacity memory_used_capacity,
485+
mem_caps.reserved_capacity memory_reserved_capacity,
486+
cpu_caps.used_capacity cpu_used_capacity,
487+
cpu_caps.reserved_capacity cpu_reserved_capacity,
488+
async_job.id job_id,
489+
async_job.uuid job_uuid,
490+
async_job.job_status job_status,
491+
async_job.account_id job_account_id,
492+
oobm.enabled AS `oobm_enabled`,
493+
oobm.power_state AS `oobm_power_state`,
494+
ha_config.enabled AS `ha_enabled`,
495+
ha_config.ha_state AS `ha_state`,
496+
ha_config.provider AS `ha_provider`,
497+
`last_annotation_view`.`annotation` AS `annotation`,
498+
`last_annotation_view`.`created` AS `last_annotated`,
499+
`user`.`username` AS `username`
500+
FROM
501+
`cloud`.`host`
502+
LEFT JOIN
503+
`cloud`.`cluster` ON host.cluster_id = cluster.id
504+
LEFT JOIN
505+
`cloud`.`data_center` ON host.data_center_id = data_center.id
506+
LEFT JOIN
507+
`cloud`.`host_pod_ref` ON host.pod_id = host_pod_ref.id
508+
LEFT JOIN
509+
`cloud`.`host_details` ON host.id = host_details.host_id
510+
AND host_details.name = 'guest.os.category.id'
511+
LEFT JOIN
512+
`cloud`.`guest_os_category` ON guest_os_category.id = CONVERT ( host_details.value, UNSIGNED )
513+
LEFT JOIN
514+
`cloud`.`host_tags` ON host_tags.host_id = host.id
515+
LEFT JOIN
516+
`cloud`.`op_host_capacity` mem_caps ON host.id = mem_caps.host_id
517+
AND mem_caps.capacity_type = 0
518+
LEFT JOIN
519+
`cloud`.`op_host_capacity` cpu_caps ON host.id = cpu_caps.host_id
520+
AND cpu_caps.capacity_type = 1
521+
LEFT JOIN
522+
`cloud`.`async_job` ON async_job.instance_id = host.id
523+
AND async_job.instance_type = 'Host'
524+
AND async_job.job_status = 0
525+
LEFT JOIN
526+
`cloud`.`oobm` ON oobm.host_id = host.id
527+
left join
528+
`cloud`.`ha_config` ON ha_config.resource_id=host.id
529+
and ha_config.resource_type='Host'
530+
LEFT JOIN
531+
`cloud`.`last_annotation_view` ON `last_annotation_view`.`entity_uuid` = `host`.`uuid`
532+
LEFT JOIN
533+
`cloud`.`user` ON `user`.`uuid` = `last_annotation_view`.`user_uuid`
534+
GROUP BY
535+
`host`.`id`;

packaging/centos7/cloud.spec

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,14 @@ grep -s -q "db.cloud.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.pr
432432
grep -s -q "db.usage.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties" || sed -i -e "\$adb.usage.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties"
433433
grep -s -q "db.simulator.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties" || sed -i -e "\$adb.simulator.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties"
434434

435+
# Update DB properties having master and slave(s), with source and replica(s) respectively (for inclusiveness)
436+
grep -s -q "^db.cloud.slaves=" "%{_sysconfdir}/%{name}/management/db.properties" && sed -i "s/^db.cloud.slaves=/db.cloud.replicas=/g" "%{_sysconfdir}/%{name}/management/db.properties"
437+
grep -s -q "^db.cloud.secondsBeforeRetryMaster=" "%{_sysconfdir}/%{name}/management/db.properties" && sed -i "s/^db.cloud.secondsBeforeRetryMaster=/db.cloud.secondsBeforeRetrySource=/g" "%{_sysconfdir}/%{name}/management/db.properties"
438+
grep -s -q "^db.cloud.queriesBeforeRetryMaster=" "%{_sysconfdir}/%{name}/management/db.properties" && sed -i "s/^db.cloud.queriesBeforeRetryMaster=/db.cloud.queriesBeforeRetrySource=/g" "%{_sysconfdir}/%{name}/management/db.properties"
439+
grep -s -q "^db.usage.slaves=" "%{_sysconfdir}/%{name}/management/db.properties" && sed -i "s/^db.usage.slaves=/db.usage.replicas=/g" "%{_sysconfdir}/%{name}/management/db.properties"
440+
grep -s -q "^db.usage.secondsBeforeRetryMaster=" "%{_sysconfdir}/%{name}/management/db.properties" && sed -i "s/^db.usage.secondsBeforeRetryMaster=/db.usage.secondsBeforeRetrySource=/g" "%{_sysconfdir}/%{name}/management/db.properties"
441+
grep -s -q "^db.usage.queriesBeforeRetryMaster=" "%{_sysconfdir}/%{name}/management/db.properties" && sed -i "s/^db.usage.queriesBeforeRetryMaster=/db.usage.queriesBeforeRetrySource=/g" "%{_sysconfdir}/%{name}/management/db.properties"
442+
435443
if [ ! -f %{_datadir}/cloudstack-common/scripts/vm/hypervisor/xenserver/vhd-util ] ; then
436444
echo Please download vhd-util from http://download.cloudstack.org/tools/vhd-util and put it in
437445
echo %{_datadir}/cloudstack-common/scripts/vm/hypervisor/xenserver/

packaging/centos8/cloud.spec

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,14 @@ grep -s -q "db.cloud.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.pr
423423
grep -s -q "db.usage.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties" || sed -i -e "\$adb.usage.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties"
424424
grep -s -q "db.simulator.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties" || sed -i -e "\$adb.simulator.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties"
425425

426+
# Update DB properties having master and slave(s), with source and replica(s) respectively (for inclusiveness)
427+
grep -s -q "^db.cloud.slaves=" "%{_sysconfdir}/%{name}/management/db.properties" && sed -i "s/^db.cloud.slaves=/db.cloud.replicas=/g" "%{_sysconfdir}/%{name}/management/db.properties"
428+
grep -s -q "^db.cloud.secondsBeforeRetryMaster=" "%{_sysconfdir}/%{name}/management/db.properties" && sed -i "s/^db.cloud.secondsBeforeRetryMaster=/db.cloud.secondsBeforeRetrySource=/g" "%{_sysconfdir}/%{name}/management/db.properties"
429+
grep -s -q "^db.cloud.queriesBeforeRetryMaster=" "%{_sysconfdir}/%{name}/management/db.properties" && sed -i "s/^db.cloud.queriesBeforeRetryMaster=/db.cloud.queriesBeforeRetrySource=/g" "%{_sysconfdir}/%{name}/management/db.properties"
430+
grep -s -q "^db.usage.slaves=" "%{_sysconfdir}/%{name}/management/db.properties" && sed -i "s/^db.usage.slaves=/db.usage.replicas=/g" "%{_sysconfdir}/%{name}/management/db.properties"
431+
grep -s -q "^db.usage.secondsBeforeRetryMaster=" "%{_sysconfdir}/%{name}/management/db.properties" && sed -i "s/^db.usage.secondsBeforeRetryMaster=/db.usage.secondsBeforeRetrySource=/g" "%{_sysconfdir}/%{name}/management/db.properties"
432+
grep -s -q "^db.usage.queriesBeforeRetryMaster=" "%{_sysconfdir}/%{name}/management/db.properties" && sed -i "s/^db.usage.queriesBeforeRetryMaster=/db.usage.queriesBeforeRetrySource=/g" "%{_sysconfdir}/%{name}/management/db.properties"
433+
426434
if [ ! -f %{_datadir}/cloudstack-common/scripts/vm/hypervisor/xenserver/vhd-util ] ; then
427435
echo Please download vhd-util from http://download.cloudstack.org/tools/vhd-util and put it in
428436
echo %{_datadir}/cloudstack-common/scripts/vm/hypervisor/xenserver/

plugins/hypervisors/kvm/src/main/java/com/cloud/ha/KVMInvestigator.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,15 @@ public Status isAgentAlive(Host agent) {
8585
break;
8686
}
8787
}
88+
if (!hasNfs) {
89+
List<StoragePoolVO> zonePools = _storagePoolDao.findZoneWideStoragePoolsByHypervisor(agent.getDataCenterId(), agent.getHypervisorType());
90+
for (StoragePoolVO pool : zonePools) {
91+
if (pool.getPoolType() == StoragePoolType.NetworkFilesystem) {
92+
hasNfs = true;
93+
break;
94+
}
95+
}
96+
}
8897
if (!hasNfs) {
8998
s_logger.warn(
9099
"Agent investigation was requested on host " + agent + ", but host does not support investigation because it has no NFS storage. Skipping investigation.");

plugins/integrations/kubernetes-service/src/main/java/com/cloud/kubernetes/cluster/actionworkers/KubernetesClusterResourceModifierActionWorker.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ protected void init() {
142142
private String getKubernetesNodeConfig(final String joinIp, final boolean ejectIso) throws IOException {
143143
String k8sNodeConfig = readResourceFile("/conf/k8s-node.yml");
144144
final String sshPubKey = "{{ k8s.ssh.pub.key }}";
145-
final String joinIpKey = "{{ k8s_master.join_ip }}";
146-
final String clusterTokenKey = "{{ k8s_master.cluster.token }}";
145+
final String joinIpKey = "{{ k8s_control_node.join_ip }}";
146+
final String clusterTokenKey = "{{ k8s_control_node.cluster.token }}";
147147
final String ejectIsoKey = "{{ k8s.eject.iso }}";
148148
String pubKey = "- \"" + configurationDao.getValue("ssh.publickey") + "\"";
149149
String sshKeyPair = kubernetesCluster.getKeyPair();

0 commit comments

Comments
 (0)