Skip to content

Commit e2cb774

Browse files
committed
Merge branch 'main' of https://github.com/apache/cloudstack into nas-br-partb
2 parents d5a259d + a303c7c commit e2cb774

File tree

36 files changed

+550
-715
lines changed

36 files changed

+550
-715
lines changed

api/src/main/java/org/apache/cloudstack/api/command/user/storage/sharedfs/ChangeSharedFSServiceOfferingCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public class ChangeSharedFSServiceOfferingCmd extends BaseAsyncCmd implements Us
7070
type = CommandType.UUID,
7171
entityType = ServiceOfferingResponse.class,
7272
required = true,
73-
description = "the offering to use for the shared filesystem vm")
73+
description = "the offering to use for the shared filesystem instance")
7474
private Long serviceOfferingId;
7575

7676
/////////////////////////////////////////////////////

api/src/main/java/org/apache/cloudstack/api/command/user/storage/sharedfs/CreateSharedFSCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public class CreateSharedFSCmd extends BaseAsyncCreateCmd implements UserCmd {
130130
type = CommandType.UUID,
131131
required = true,
132132
entityType = ServiceOfferingResponse.class,
133-
description = "the service offering to use for the shared filesystem VM hosting the data. The offering should be HA enabled and the cpu count and memory size should be greater than equal to sharedfsvm.min.cpu.count and sharedfsvm.min.ram.size respectively")
133+
description = "the service offering to use for the shared filesystem instance hosting the data. The offering should be HA enabled and the cpu count and memory size should be greater than equal to sharedfsvm.min.cpu.count and sharedfsvm.min.ram.size respectively")
134134
private Long serviceOfferingId;
135135

136136
@Parameter(name = ApiConstants.FILESYSTEM,

api/src/main/java/org/apache/cloudstack/api/response/CapabilitiesResponse.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,11 @@ public class CapabilitiesResponse extends BaseResponse {
129129
private Integer instancesDisksStatsRetentionTime;
130130

131131
@SerializedName(ApiConstants.SHAREDFSVM_MIN_CPU_COUNT)
132-
@Param(description = "the min CPU count for the service offering used by the shared filesystem VM", since = "4.20.0")
132+
@Param(description = "the min CPU count for the service offering used by the shared filesystem instance", since = "4.20.0")
133133
private Integer sharedFsVmMinCpuCount;
134134

135135
@SerializedName(ApiConstants.SHAREDFSVM_MIN_RAM_SIZE)
136-
@Param(description = "the min Ram size for the service offering used by the shared filesystem VM", since = "4.20.0")
136+
@Param(description = "the min Ram size for the service offering used by the shared filesystem instance", since = "4.20.0")
137137
private Integer sharedFsVmMinRamSize;
138138

139139
public void setSecurityGroupsEnabled(boolean securityGroupsEnabled) {

api/src/main/java/org/apache/cloudstack/storage/sharedfs/SharedFS.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public interface SharedFS extends ControlledEntity, Identity, InternalIdentity,
6464
null,
6565
SharedFSFeatureEnabled.key());
6666

67-
String SharedFSVmNamePrefix = "fsvm";
67+
String SharedFSVmNamePrefix = "sharedfs";
6868
String SharedFSPath = "/export";
6969

7070
enum FileSystemType {

core/src/main/java/com/cloud/network/HAProxyConfigurator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ private List<String> getRulesForPool(final LoadBalancerTO lbTO, final boolean ke
485485
sb.append("\tbind ").append(publicIP).append(":").append(publicPort);
486486
result.add(sb.toString());
487487
sb = new StringBuilder();
488-
sb.append("\t").append("balance ").append(algorithm);
488+
sb.append("\t").append("balance ").append(algorithm.toLowerCase());
489489
result.add(sb.toString());
490490

491491
int i = 0;

engine/schema/src/main/resources/META-INF/db/schema-41910to42000.sql

Lines changed: 2 additions & 200 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ CREATE TABLE `cloud`.`ip4_guest_subnet_network_map` (
193193
CONSTRAINT `uc_ip4_guest_subnet_network_map__uuid` UNIQUE (`uuid`)
194194
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
195195

196-
ALTER TABLE `cloud`.`network_offerings` RENAME COLUMN `nsx_mode` TO `network_mode`;
197-
ALTER TABLE `cloud`.`vpc_offerings` RENAME COLUMN `nsx_mode` TO `network_mode`;
196+
CALL `cloud`.`IDEMPOTENT_CHANGE_COLUMN`('network_offerings', 'nsx_mode', 'network_mode', 'varchar(32) COMMENT "mode in which the network would route traffic"');
197+
CALL `cloud`.`IDEMPOTENT_CHANGE_COLUMN`('vpc_offerings', 'nsx_mode', 'network_mode', 'varchar(32) COMMENT "mode in which the network would route traffic"');
198198
ALTER TABLE `cloud`.`event` MODIFY COLUMN `type` varchar(50) NOT NULL;
199199

200200
-- Add tables for AS Numbers and range
@@ -307,204 +307,6 @@ CREATE TABLE `cloud`.`shared_filesystem`(
307307
INDEX `i_shared_filesystem__domain_id`(`domain_id`)
308308
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
309309

310-
DROP VIEW IF EXISTS `cloud`.`user_vm_view`;
311-
CREATE VIEW `user_vm_view` AS
312-
SELECT
313-
`vm_instance`.`id` AS `id`,
314-
`vm_instance`.`name` AS `name`,
315-
`user_vm`.`display_name` AS `display_name`,
316-
`user_vm`.`user_data` AS `user_data`,
317-
`user_vm`.`user_vm_type` AS `user_vm_type`,
318-
`account`.`id` AS `account_id`,
319-
`account`.`uuid` AS `account_uuid`,
320-
`account`.`account_name` AS `account_name`,
321-
`account`.`type` AS `account_type`,
322-
`domain`.`id` AS `domain_id`,
323-
`domain`.`uuid` AS `domain_uuid`,
324-
`domain`.`name` AS `domain_name`,
325-
`domain`.`path` AS `domain_path`,
326-
`projects`.`id` AS `project_id`,
327-
`projects`.`uuid` AS `project_uuid`,
328-
`projects`.`name` AS `project_name`,
329-
`instance_group`.`id` AS `instance_group_id`,
330-
`instance_group`.`uuid` AS `instance_group_uuid`,
331-
`instance_group`.`name` AS `instance_group_name`,
332-
`vm_instance`.`uuid` AS `uuid`,
333-
`vm_instance`.`user_id` AS `user_id`,
334-
`vm_instance`.`last_host_id` AS `last_host_id`,
335-
`vm_instance`.`vm_type` AS `type`,
336-
`vm_instance`.`limit_cpu_use` AS `limit_cpu_use`,
337-
`vm_instance`.`created` AS `created`,
338-
`vm_instance`.`state` AS `state`,
339-
`vm_instance`.`update_time` AS `update_time`,
340-
`vm_instance`.`removed` AS `removed`,
341-
`vm_instance`.`ha_enabled` AS `ha_enabled`,
342-
`vm_instance`.`hypervisor_type` AS `hypervisor_type`,
343-
`vm_instance`.`instance_name` AS `instance_name`,
344-
`vm_instance`.`guest_os_id` AS `guest_os_id`,
345-
`vm_instance`.`display_vm` AS `display_vm`,
346-
`guest_os`.`uuid` AS `guest_os_uuid`,
347-
`vm_instance`.`pod_id` AS `pod_id`,
348-
`host_pod_ref`.`uuid` AS `pod_uuid`,
349-
`vm_instance`.`private_ip_address` AS `private_ip_address`,
350-
`vm_instance`.`private_mac_address` AS `private_mac_address`,
351-
`vm_instance`.`vm_type` AS `vm_type`,
352-
`data_center`.`id` AS `data_center_id`,
353-
`data_center`.`uuid` AS `data_center_uuid`,
354-
`data_center`.`name` AS `data_center_name`,
355-
`data_center`.`is_security_group_enabled` AS `security_group_enabled`,
356-
`data_center`.`networktype` AS `data_center_network_type`,
357-
`host`.`id` AS `host_id`,
358-
`host`.`uuid` AS `host_uuid`,
359-
`host`.`name` AS `host_name`,
360-
`host`.`cluster_id` AS `cluster_id`,
361-
`host`.`status` AS `host_status`,
362-
`host`.`resource_state` AS `host_resource_state`,
363-
`vm_template`.`id` AS `template_id`,
364-
`vm_template`.`uuid` AS `template_uuid`,
365-
`vm_template`.`name` AS `template_name`,
366-
`vm_template`.`type` AS `template_type`,
367-
`vm_template`.`format` AS `template_format`,
368-
`vm_template`.`display_text` AS `template_display_text`,
369-
`vm_template`.`enable_password` AS `password_enabled`,
370-
`iso`.`id` AS `iso_id`,
371-
`iso`.`uuid` AS `iso_uuid`,
372-
`iso`.`name` AS `iso_name`,
373-
`iso`.`display_text` AS `iso_display_text`,
374-
`service_offering`.`id` AS `service_offering_id`,
375-
`service_offering`.`uuid` AS `service_offering_uuid`,
376-
`disk_offering`.`uuid` AS `disk_offering_uuid`,
377-
`disk_offering`.`id` AS `disk_offering_id`,
378-
(CASE
379-
WHEN ISNULL(`service_offering`.`cpu`) THEN `custom_cpu`.`value`
380-
ELSE `service_offering`.`cpu`
381-
END) AS `cpu`,
382-
(CASE
383-
WHEN ISNULL(`service_offering`.`speed`) THEN `custom_speed`.`value`
384-
ELSE `service_offering`.`speed`
385-
END) AS `speed`,
386-
(CASE
387-
WHEN ISNULL(`service_offering`.`ram_size`) THEN `custom_ram_size`.`value`
388-
ELSE `service_offering`.`ram_size`
389-
END) AS `ram_size`,
390-
`backup_offering`.`uuid` AS `backup_offering_uuid`,
391-
`backup_offering`.`id` AS `backup_offering_id`,
392-
`service_offering`.`name` AS `service_offering_name`,
393-
`disk_offering`.`name` AS `disk_offering_name`,
394-
`backup_offering`.`name` AS `backup_offering_name`,
395-
`storage_pool`.`id` AS `pool_id`,
396-
`storage_pool`.`uuid` AS `pool_uuid`,
397-
`storage_pool`.`pool_type` AS `pool_type`,
398-
`volumes`.`id` AS `volume_id`,
399-
`volumes`.`uuid` AS `volume_uuid`,
400-
`volumes`.`device_id` AS `volume_device_id`,
401-
`volumes`.`volume_type` AS `volume_type`,
402-
`security_group`.`id` AS `security_group_id`,
403-
`security_group`.`uuid` AS `security_group_uuid`,
404-
`security_group`.`name` AS `security_group_name`,
405-
`security_group`.`description` AS `security_group_description`,
406-
`nics`.`id` AS `nic_id`,
407-
`nics`.`uuid` AS `nic_uuid`,
408-
`nics`.`device_id` AS `nic_device_id`,
409-
`nics`.`network_id` AS `network_id`,
410-
`nics`.`ip4_address` AS `ip_address`,
411-
`nics`.`ip6_address` AS `ip6_address`,
412-
`nics`.`ip6_gateway` AS `ip6_gateway`,
413-
`nics`.`ip6_cidr` AS `ip6_cidr`,
414-
`nics`.`default_nic` AS `is_default_nic`,
415-
`nics`.`gateway` AS `gateway`,
416-
`nics`.`netmask` AS `netmask`,
417-
`nics`.`mac_address` AS `mac_address`,
418-
`nics`.`broadcast_uri` AS `broadcast_uri`,
419-
`nics`.`isolation_uri` AS `isolation_uri`,
420-
`vpc`.`id` AS `vpc_id`,
421-
`vpc`.`uuid` AS `vpc_uuid`,
422-
`networks`.`uuid` AS `network_uuid`,
423-
`networks`.`name` AS `network_name`,
424-
`networks`.`traffic_type` AS `traffic_type`,
425-
`networks`.`guest_type` AS `guest_type`,
426-
`user_ip_address`.`id` AS `public_ip_id`,
427-
`user_ip_address`.`uuid` AS `public_ip_uuid`,
428-
`user_ip_address`.`public_ip_address` AS `public_ip_address`,
429-
`ssh_details`.`value` AS `keypair_names`,
430-
`resource_tags`.`id` AS `tag_id`,
431-
`resource_tags`.`uuid` AS `tag_uuid`,
432-
`resource_tags`.`key` AS `tag_key`,
433-
`resource_tags`.`value` AS `tag_value`,
434-
`resource_tags`.`domain_id` AS `tag_domain_id`,
435-
`domain`.`uuid` AS `tag_domain_uuid`,
436-
`domain`.`name` AS `tag_domain_name`,
437-
`resource_tags`.`account_id` AS `tag_account_id`,
438-
`account`.`account_name` AS `tag_account_name`,
439-
`resource_tags`.`resource_id` AS `tag_resource_id`,
440-
`resource_tags`.`resource_uuid` AS `tag_resource_uuid`,
441-
`resource_tags`.`resource_type` AS `tag_resource_type`,
442-
`resource_tags`.`customer` AS `tag_customer`,
443-
`async_job`.`id` AS `job_id`,
444-
`async_job`.`uuid` AS `job_uuid`,
445-
`async_job`.`job_status` AS `job_status`,
446-
`async_job`.`account_id` AS `job_account_id`,
447-
`affinity_group`.`id` AS `affinity_group_id`,
448-
`affinity_group`.`uuid` AS `affinity_group_uuid`,
449-
`affinity_group`.`name` AS `affinity_group_name`,
450-
`affinity_group`.`description` AS `affinity_group_description`,
451-
`autoscale_vmgroups`.`id` AS `autoscale_vmgroup_id`,
452-
`autoscale_vmgroups`.`uuid` AS `autoscale_vmgroup_uuid`,
453-
`autoscale_vmgroups`.`name` AS `autoscale_vmgroup_name`,
454-
`vm_instance`.`dynamically_scalable` AS `dynamically_scalable`,
455-
`user_data`.`id` AS `user_data_id`,
456-
`user_data`.`uuid` AS `user_data_uuid`,
457-
`user_data`.`name` AS `user_data_name`,
458-
`user_vm`.`user_data_details` AS `user_data_details`,
459-
`vm_template`.`user_data_link_policy` AS `user_data_policy`
460-
FROM
461-
(((((((((((((((((((((((((((((((((((`user_vm`
462-
JOIN `vm_instance` ON (((`vm_instance`.`id` = `user_vm`.`id`)
463-
AND ISNULL(`vm_instance`.`removed`))))
464-
JOIN `account` ON ((`vm_instance`.`account_id` = `account`.`id`)))
465-
JOIN `domain` ON ((`vm_instance`.`domain_id` = `domain`.`id`)))
466-
LEFT JOIN `guest_os` ON ((`vm_instance`.`guest_os_id` = `guest_os`.`id`)))
467-
LEFT JOIN `host_pod_ref` ON ((`vm_instance`.`pod_id` = `host_pod_ref`.`id`)))
468-
LEFT JOIN `projects` ON ((`projects`.`project_account_id` = `account`.`id`)))
469-
LEFT JOIN `instance_group_vm_map` ON ((`vm_instance`.`id` = `instance_group_vm_map`.`instance_id`)))
470-
LEFT JOIN `instance_group` ON ((`instance_group_vm_map`.`group_id` = `instance_group`.`id`)))
471-
LEFT JOIN `data_center` ON ((`vm_instance`.`data_center_id` = `data_center`.`id`)))
472-
LEFT JOIN `host` ON ((`vm_instance`.`host_id` = `host`.`id`)))
473-
LEFT JOIN `vm_template` ON ((`vm_instance`.`vm_template_id` = `vm_template`.`id`)))
474-
LEFT JOIN `vm_template` `iso` ON ((`iso`.`id` = `user_vm`.`iso_id`)))
475-
LEFT JOIN `volumes` ON ((`vm_instance`.`id` = `volumes`.`instance_id`)))
476-
LEFT JOIN `service_offering` ON ((`vm_instance`.`service_offering_id` = `service_offering`.`id`)))
477-
LEFT JOIN `disk_offering` `svc_disk_offering` ON ((`volumes`.`disk_offering_id` = `svc_disk_offering`.`id`)))
478-
LEFT JOIN `disk_offering` ON ((`volumes`.`disk_offering_id` = `disk_offering`.`id`)))
479-
LEFT JOIN `backup_offering` ON ((`vm_instance`.`backup_offering_id` = `backup_offering`.`id`)))
480-
LEFT JOIN `storage_pool` ON ((`volumes`.`pool_id` = `storage_pool`.`id`)))
481-
LEFT JOIN `security_group_vm_map` ON ((`vm_instance`.`id` = `security_group_vm_map`.`instance_id`)))
482-
LEFT JOIN `security_group` ON ((`security_group_vm_map`.`security_group_id` = `security_group`.`id`)))
483-
LEFT JOIN `user_data` ON ((`user_data`.`id` = `user_vm`.`user_data_id`)))
484-
LEFT JOIN `nics` ON (((`vm_instance`.`id` = `nics`.`instance_id`)
485-
AND ISNULL(`nics`.`removed`))))
486-
LEFT JOIN `networks` ON ((`nics`.`network_id` = `networks`.`id`)))
487-
LEFT JOIN `vpc` ON (((`networks`.`vpc_id` = `vpc`.`id`)
488-
AND ISNULL(`vpc`.`removed`))))
489-
LEFT JOIN `user_ip_address` FORCE INDEX(`fk_user_ip_address__vm_id`) ON ((`user_ip_address`.`vm_id` = `vm_instance`.`id`)))
490-
LEFT JOIN `user_vm_details` `ssh_details` ON (((`ssh_details`.`vm_id` = `vm_instance`.`id`)
491-
AND (`ssh_details`.`name` = 'SSH.KeyPairNames'))))
492-
LEFT JOIN `resource_tags` ON (((`resource_tags`.`resource_id` = `vm_instance`.`id`)
493-
AND (`resource_tags`.`resource_type` = 'UserVm'))))
494-
LEFT JOIN `async_job` ON (((`async_job`.`instance_id` = `vm_instance`.`id`)
495-
AND (`async_job`.`instance_type` = 'VirtualMachine')
496-
AND (`async_job`.`job_status` = 0))))
497-
LEFT JOIN `affinity_group_vm_map` ON ((`vm_instance`.`id` = `affinity_group_vm_map`.`instance_id`)))
498-
LEFT JOIN `affinity_group` ON ((`affinity_group_vm_map`.`affinity_group_id` = `affinity_group`.`id`)))
499-
LEFT JOIN `autoscale_vmgroup_vm_map` ON ((`autoscale_vmgroup_vm_map`.`instance_id` = `vm_instance`.`id`)))
500-
LEFT JOIN `autoscale_vmgroups` ON ((`autoscale_vmgroup_vm_map`.`vmgroup_id` = `autoscale_vmgroups`.`id`)))
501-
LEFT JOIN `user_vm_details` `custom_cpu` ON (((`custom_cpu`.`vm_id` = `vm_instance`.`id`)
502-
AND (`custom_cpu`.`name` = 'CpuNumber'))))
503-
LEFT JOIN `user_vm_details` `custom_speed` ON (((`custom_speed`.`vm_id` = `vm_instance`.`id`)
504-
AND (`custom_speed`.`name` = 'CpuSpeed'))))
505-
LEFT JOIN `user_vm_details` `custom_ram_size` ON (((`custom_ram_size`.`vm_id` = `vm_instance`.`id`)
506-
AND (`custom_ram_size`.`name` = 'memory'))));
507-
508310
-- Quota inject tariff result into subsequent ones
509311
CALL `cloud_usage`.`IDEMPOTENT_ADD_COLUMN`('cloud_usage.quota_tariff', 'position', 'bigint(20) NOT NULL DEFAULT 1 COMMENT "Position in the execution sequence for tariffs of the same type"');
510312

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2511,7 +2511,9 @@ public Answer copyVolumeFromPrimaryToPrimary(CopyCommand cmd) {
25112511

25122512
destPool = storagePoolMgr.getStoragePool(destPrimaryStore.getPoolType(), destPrimaryStore.getUuid());
25132513
try {
2514-
if (srcVol.getPassphrase() != null && srcVol.getVolumeType().equals(Volume.Type.ROOT)) {
2514+
Volume.Type volumeType = srcVol.getVolumeType();
2515+
2516+
if (srcVol.getPassphrase() != null && (Volume.Type.ROOT.equals(volumeType) || Volume.Type.DATADISK.equals(volumeType))) {
25152517
volume.setQemuEncryptFormat(QemuObject.EncryptFormat.LUKS);
25162518
storagePoolMgr.copyPhysicalDisk(volume, destVolumeName, destPool, cmd.getWaitInMillSeconds(), srcVol.getPassphrase(), destVol.getPassphrase(), srcVol.getProvisioningType());
25172519
} else {

0 commit comments

Comments
 (0)