Skip to content

Commit 10486ea

Browse files
author
Vijayendra Bhamidipati
committed
CLOUDSTACK-4645: There is no upgrade path from 4.1.1 to 4.2.0
Description: Simpler fix to support upgrade path from 4.1.1 to 4.2.0 by adding a 4.1.1 string in the db update version range. Commit # d1642a4 introduced a duplicate user_vm_view view in the schema-410to420.sql script. Removing the first occurrence of that view, since whatever QA has been testing until now would have used the duplicated view that gets created after the first one.
1 parent 5122433 commit 10486ea

3 files changed

Lines changed: 4 additions & 180 deletions

File tree

engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ public DatabaseUpgradeChecker() {
173173
_upgradeMap.put("4.0.2", new DbUpgrade[] { new Upgrade40to41(), new Upgrade410to420() });
174174

175175
_upgradeMap.put("4.1.0", new DbUpgrade[] { new Upgrade410to420() });
176+
177+
_upgradeMap.put("4.1.1", new DbUpgrade[] { new Upgrade410to420() });
176178

177179
//CP Upgrades
178180
_upgradeMap.put("3.0.3", new DbUpgrade[] { new Upgrade303to304(), new Upgrade304to305(), new Upgrade305to306(), new Upgrade306to307(), new Upgrade307to410(), new Upgrade410to420() });

engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public class Upgrade410to420 implements DbUpgrade {
5151

5252
@Override
5353
public String[] getUpgradableVersionRange() {
54-
return new String[] { "4.1.0", "4.2.0" };
54+
return new String[] { "4.1.0", "4.1.1" };
5555
}
5656

5757
@Override

setup/db/db/schema-410to420.sql

Lines changed: 1 addition & 179 deletions
Original file line numberDiff line numberDiff line change
@@ -722,185 +722,7 @@ CREATE TABLE `cloud`.`service_offering_details` (
722722
CONSTRAINT `fk_service_offering_details__service_offering_id` FOREIGN KEY (`service_offering_id`) REFERENCES `service_offering`(`id`) ON DELETE CASCADE,
723723
CONSTRAINT UNIQUE KEY `uk_service_offering_id_name` (`service_offering_id`, `name`)
724724
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
725-
726-
DROP VIEW IF EXISTS `cloud`.`user_vm_view`;
727-
CREATE VIEW `cloud`.`user_vm_view` AS
728-
select
729-
vm_instance.id id,
730-
vm_instance.name name,
731-
user_vm.display_name display_name,
732-
user_vm.user_data user_data,
733-
account.id account_id,
734-
account.uuid account_uuid,
735-
account.account_name account_name,
736-
account.type account_type,
737-
domain.id domain_id,
738-
domain.uuid domain_uuid,
739-
domain.name domain_name,
740-
domain.path domain_path,
741-
projects.id project_id,
742-
projects.uuid project_uuid,
743-
projects.name project_name,
744-
instance_group.id instance_group_id,
745-
instance_group.uuid instance_group_uuid,
746-
instance_group.name instance_group_name,
747-
vm_instance.uuid uuid,
748-
vm_instance.last_host_id last_host_id,
749-
vm_instance.vm_type type,
750-
vm_instance.vnc_password vnc_password,
751-
vm_instance.limit_cpu_use limit_cpu_use,
752-
vm_instance.created created,
753-
vm_instance.state state,
754-
vm_instance.removed removed,
755-
vm_instance.ha_enabled ha_enabled,
756-
vm_instance.hypervisor_type hypervisor_type,
757-
vm_instance.instance_name instance_name,
758-
vm_instance.guest_os_id guest_os_id,
759-
guest_os.uuid guest_os_uuid,
760-
vm_instance.pod_id pod_id,
761-
host_pod_ref.uuid pod_uuid,
762-
vm_instance.private_ip_address private_ip_address,
763-
vm_instance.private_mac_address private_mac_address,
764-
vm_instance.vm_type vm_type,
765-
data_center.id data_center_id,
766-
data_center.uuid data_center_uuid,
767-
data_center.name data_center_name,
768-
data_center.networktype data_center_type,
769-
data_center.is_security_group_enabled security_group_enabled,
770-
host.id host_id,
771-
host.uuid host_uuid,
772-
host.name host_name,
773-
vm_template.id template_id,
774-
vm_template.uuid template_uuid,
775-
vm_template.name template_name,
776-
vm_template.display_text template_display_text,
777-
vm_template.enable_password password_enabled,
778-
iso.id iso_id,
779-
iso.uuid iso_uuid,
780-
iso.name iso_name,
781-
iso.display_text iso_display_text,
782-
service_offering.id service_offering_id,
783-
disk_offering.uuid service_offering_uuid,
784-
service_offering.cpu cpu,
785-
service_offering.speed speed,
786-
service_offering.ram_size ram_size,
787-
disk_offering.name service_offering_name,
788-
storage_pool.id pool_id,
789-
storage_pool.uuid pool_uuid,
790-
storage_pool.pool_type pool_type,
791-
volumes.id volume_id,
792-
volumes.uuid volume_uuid,
793-
volumes.device_id volume_device_id,
794-
volumes.volume_type volume_type,
795-
security_group.id security_group_id,
796-
security_group.uuid security_group_uuid,
797-
security_group.name security_group_name,
798-
security_group.description security_group_description,
799-
nics.id nic_id,
800-
nics.uuid nic_uuid,
801-
nics.network_id network_id,
802-
nics.ip4_address ip_address,
803-
nics.ip6_address ip6_address,
804-
nics.ip6_gateway ip6_gateway,
805-
nics.ip6_cidr ip6_cidr,
806-
nics.default_nic is_default_nic,
807-
nics.gateway gateway,
808-
nics.netmask netmask,
809-
nics.mac_address mac_address,
810-
nics.broadcast_uri broadcast_uri,
811-
nics.isolation_uri isolation_uri,
812-
vpc.id vpc_id,
813-
vpc.uuid vpc_uuid,
814-
networks.uuid network_uuid,
815-
networks.name network_name,
816-
networks.traffic_type traffic_type,
817-
networks.guest_type guest_type,
818-
user_ip_address.id public_ip_id,
819-
user_ip_address.uuid public_ip_uuid,
820-
user_ip_address.public_ip_address public_ip_address,
821-
ssh_keypairs.keypair_name keypair_name,
822-
resource_tags.id tag_id,
823-
resource_tags.uuid tag_uuid,
824-
resource_tags.key tag_key,
825-
resource_tags.value tag_value,
826-
resource_tags.domain_id tag_domain_id,
827-
resource_tags.account_id tag_account_id,
828-
resource_tags.resource_id tag_resource_id,
829-
resource_tags.resource_uuid tag_resource_uuid,
830-
resource_tags.resource_type tag_resource_type,
831-
resource_tags.customer tag_customer,
832-
async_job.id job_id,
833-
async_job.uuid job_uuid,
834-
async_job.job_status job_status,
835-
async_job.account_id job_account_id,
836-
affinity_group.id affinity_group_id,
837-
affinity_group.uuid affinity_group_uuid,
838-
affinity_group.name affinity_group_name,
839-
affinity_group.description affinity_group_description
840-
from
841-
`cloud`.`user_vm`
842-
inner join
843-
`cloud`.`vm_instance` ON vm_instance.id = user_vm.id
844-
and vm_instance.removed is NULL
845-
inner join
846-
`cloud`.`account` ON vm_instance.account_id = account.id
847-
inner join
848-
`cloud`.`domain` ON vm_instance.domain_id = domain.id
849-
left join
850-
`cloud`.`guest_os` ON vm_instance.guest_os_id = guest_os.id
851-
left join
852-
`cloud`.`host_pod_ref` ON vm_instance.pod_id = host_pod_ref.id
853-
left join
854-
`cloud`.`projects` ON projects.project_account_id = account.id
855-
left join
856-
`cloud`.`instance_group_vm_map` ON vm_instance.id = instance_group_vm_map.instance_id
857-
left join
858-
`cloud`.`instance_group` ON instance_group_vm_map.group_id = instance_group.id
859-
left join
860-
`cloud`.`data_center` ON vm_instance.data_center_id = data_center.id
861-
left join
862-
`cloud`.`host` ON vm_instance.host_id = host.id
863-
left join
864-
`cloud`.`vm_template` ON vm_instance.vm_template_id = vm_template.id
865-
left join
866-
`cloud`.`vm_template` iso ON iso.id = user_vm.iso_id
867-
left join
868-
`cloud`.`service_offering` ON vm_instance.service_offering_id = service_offering.id
869-
left join
870-
`cloud`.`disk_offering` ON vm_instance.service_offering_id = disk_offering.id
871-
left join
872-
`cloud`.`volumes` ON vm_instance.id = volumes.instance_id
873-
left join
874-
`cloud`.`storage_pool` ON volumes.pool_id = storage_pool.id
875-
left join
876-
`cloud`.`security_group_vm_map` ON vm_instance.id = security_group_vm_map.instance_id
877-
left join
878-
`cloud`.`security_group` ON security_group_vm_map.security_group_id = security_group.id
879-
left join
880-
`cloud`.`nics` ON vm_instance.id = nics.instance_id
881-
left join
882-
`cloud`.`networks` ON nics.network_id = networks.id
883-
left join
884-
`cloud`.`vpc` ON networks.vpc_id = vpc.id
885-
left join
886-
`cloud`.`user_ip_address` ON user_ip_address.vm_id = vm_instance.id
887-
left join
888-
`cloud`.`user_vm_details` ON user_vm_details.vm_id = vm_instance.id
889-
and user_vm_details.name = 'SSH.PublicKey'
890-
left join
891-
`cloud`.`ssh_keypairs` ON ssh_keypairs.public_key = user_vm_details.value
892-
left join
893-
`cloud`.`resource_tags` ON resource_tags.resource_id = vm_instance.id
894-
and resource_tags.resource_type = 'UserVm'
895-
left join
896-
`cloud`.`async_job` ON async_job.instance_id = vm_instance.id
897-
and async_job.instance_type = 'VirtualMachine'
898-
and async_job.job_status = 0
899-
left join
900-
`cloud`.`affinity_group_vm_map` ON vm_instance.id = affinity_group_vm_map.instance_id
901-
left join
902-
`cloud`.`affinity_group` ON affinity_group_vm_map.affinity_group_id = affinity_group.id;
903-
725+
904726
DROP VIEW IF EXISTS `cloud`.`affinity_group_view`;
905727
CREATE VIEW `cloud`.`affinity_group_view` AS
906728
select

0 commit comments

Comments
 (0)