From 3efae4b476f12069c8226a15fe67d4721d40f63f Mon Sep 17 00:00:00 2001 From: Abhinandan Prateek Date: Sat, 27 Jul 2013 17:08:55 +0530 Subject: [PATCH 1/5] CLOUDSTACK-3480: updated md5 checksum --- setup/db/templates.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup/db/templates.sql b/setup/db/templates.sql index 143b12d9985..ba1384101dc 100755 --- a/setup/db/templates.sql +++ b/setup/db/templates.sql @@ -22,7 +22,7 @@ INSERT INTO `cloud`.`vm_template` (id, uuid, unique_name, name, public, created, VALUES (2, UUID(), 'centos53-x86_64', 'CentOS 5.3(64-bit) no GUI (XenServer)', 1, now(), now(), 'BUILTIN', 0, 64, 1, 'http://download.cloud.com/templates/builtin/f59f18fb-ae94-4f97-afd2-f84755767aca.vhd.bz2', 'b63d854a9560c013142567bbae8d98cf', 0, 'CentOS 5.3(64-bit) no GUI (XenServer)', 'VHD', 12, 1, 1, 'XenServer', 1); INSERT INTO `cloud`.`vm_template` (id, uuid, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured, cross_zones, hypervisor_type) - VALUES (3, UUID(), 'routing-3', 'SystemVM Template (KVM)', 0, now(), 'SYSTEM', 0, 64, 1, 'http://download.cloud.com/templates/4.2/systemvmtemplate-2013-06-12-master-kvm.qcow2.bz2', '2755de1f9ef2ce4d6f2bee2efbb4da92', 0, 'SystemVM Template (KVM)', 'QCOW2', 15, 0, 1, 'KVM' ); + VALUES (3, UUID(), 'routing-3', 'SystemVM Template (KVM)', 0, now(), 'SYSTEM', 0, 64, 1, 'http://download.cloud.com/templates/4.2/systemvmtemplate-2013-06-12-master-kvm.qcow2.bz2', '6cea42b2633841648040becb588bd8f0', 0, 'SystemVM Template (KVM)', 'QCOW2', 15, 0, 1, 'KVM' ); INSERT INTO `cloud`.`vm_template` (id, uuid, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, display_text, enable_password, format, guest_os_id, featured, cross_zones, hypervisor_type, extractable) VALUES (4, UUID(), 'centos55-x86_64', 'CentOS 5.5(64-bit) no GUI (KVM)', 1, now(), 'BUILTIN', 0, 64, 1, 'http://download.cloud.com/releases/2.2.0/eec2209b-9875-3c8d-92be-c001bd8a0faf.qcow2.bz2', 'ed0e788280ff2912ea40f7f91ca7a249', 'CentOS 5.5(64-bit) no GUI (KVM)', 0, 'QCOW2', 112, 1, 1, 'KVM', 1); @@ -34,10 +34,10 @@ INSERT INTO `cloud`.`vm_template` (id, uuid, unique_name, name, public, created, VALUES (7, UUID(), 'centos53-x64', 'CentOS 5.3(64-bit) no GUI (vSphere)', 1, now(), 'BUILTIN', 0, 64, 1, 'http://download.cloud.com/releases/2.2.0/CentOS5.3-x86_64.ova', 'f6f881b7f2292948d8494db837fe0f47', 0, 'CentOS 5.3(64-bit) no GUI (vSphere)', 'OVA', 12, 1, 1, 'VMware', 1); INSERT INTO `cloud`.`vm_template` (id, uuid, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured, cross_zones, hypervisor_type) - VALUES (8, UUID(), 'routing-8', 'SystemVM Template (vSphere)', 0, now(), 'SYSTEM', 0, 32, 1, 'http://download.cloud.com/templates/4.2/systemvmtemplate-4.2-vh7.ova', '7137e453f950079ea2ba6feaafd939e8', 0, 'SystemVM Template (vSphere)', 'OVA', 15, 0, 1, 'VMware' ); + VALUES (8, UUID(), 'routing-8', 'SystemVM Template (vSphere)', 0, now(), 'SYSTEM', 0, 32, 1, 'http://download.cloud.com/templates/4.2/systemvmtemplate-4.2-vh7.ova', '8fde62b1089e5844a9cd3b9b953f9596', 0, 'SystemVM Template (vSphere)', 'OVA', 15, 0, 1, 'VMware' ); INSERT INTO `cloud`.`vm_template` (id, uuid, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured, cross_zones, hypervisor_type) - VALUES (9, UUID(), 'routing-9', 'SystemVM Template (HyperV)', 0, now(), 'SYSTEM', 0, 32, 1, 'http://download.cloud.com/templates/4.2/systemvmtemplate-2013-06-12-master-xen.vhd.bz2', 'f613f38c96bf039f2e5cbf92fa8ad4f8', 0, 'SystemVM Template (HyperV)', 'VHD', 15, 0, 1, 'Hyperv' ); + VALUES (9, UUID(), 'routing-9', 'SystemVM Template (HyperV)', 0, now(), 'SYSTEM', 0, 32, 1, 'http://download.cloud.com/templates/4.2/systemvmtemplate-2013-06-12-master-xen.vhd.bz2', 'fb1b6e032a160d86f2c28feb5add6d83', 0, 'SystemVM Template (HyperV)', 'VHD', 15, 0, 1, 'Hyperv' ); INSERT INTO `cloud`.`guest_os_category` (id, uuid, name) VALUES (1, UUID(), 'CentOS'); INSERT INTO `cloud`.`guest_os_category` (id, uuid, name) VALUES (2, UUID(), 'Debian'); From a851ad24306581031f550f316eba0a6cc2f797bf Mon Sep 17 00:00:00 2001 From: Murali Reddy Date: Sat, 27 Jul 2013 17:15:14 +0530 Subject: [PATCH 2/5] CLOUDSTACK-3834: 3.0.6 to ASF 4.2 Upgrade: "cloud" Database Schema Inconsistencies on the Upgraded Setup - Table "netscaler_pod_ref" adding netscaler_pod_ref table 3.0.7 to 4.1 upgrade path --- setup/db/db/schema-307to410.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/setup/db/db/schema-307to410.sql b/setup/db/db/schema-307to410.sql index cbd564ded89..414d3bcd503 100644 --- a/setup/db/db/schema-307to410.sql +++ b/setup/db/db/schema-307to410.sql @@ -1554,3 +1554,13 @@ CREATE TABLE IF NOT EXISTS `cloud`.`baremetal_pxe_devices` ( #drop tables as the feature is not a part of 4.2 DROP TABLE IF EXISTS `cloud`.`host_updates`; DROP TABLE IF EXISTS `cloud`.`host_updates_ref`; + +DROP TABLE IF EXISTS `cloud`.`netscaler_pod_ref`; +CREATE TABLE `cloud`.`netscaler_pod_ref` ( + `id` bigint unsigned NOT NULL auto_increment COMMENT 'id', + `external_load_balancer_device_id` bigint unsigned NOT NULL COMMENT 'id of external load balancer device', + `pod_id` bigint unsigned NOT NULL COMMENT 'pod id', + PRIMARY KEY (`id`), + CONSTRAINT `fk_ns_pod_ref__pod_id` FOREIGN KEY (`pod_id`) REFERENCES `cloud`.`host_pod_ref`(`id`) ON DELETE CASCADE, + CONSTRAINT `fk_ns_pod_ref__device_id` FOREIGN KEY (`external_load_balancer_device_id`) REFERENCES `external_load_balancer_devices`(`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; \ No newline at end of file From b39d302888f965c5c26812b556c2dc395c53bb5c Mon Sep 17 00:00:00 2001 From: Prasanna Santhanam Date: Sat, 27 Jul 2013 19:46:37 +0530 Subject: [PATCH 3/5] CLOUDSTACK-2882: Additional device types for IDE/SCSI Signed-off-by: Prasanna Santhanam --- test/integration/smoke/test_vm_life_cycle.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/test/integration/smoke/test_vm_life_cycle.py b/test/integration/smoke/test_vm_life_cycle.py index c2c25928375..7dab5cf26e7 100644 --- a/test/integration/smoke/test_vm_life_cycle.py +++ b/test/integration/smoke/test_vm_life_cycle.py @@ -116,7 +116,7 @@ class Services: "name": "Cent OS Template", "passwordenabled": True, }, - "diskdevice": ['/dev/xvdd', '/dev/cdrom', '/dev/sr0', '/dev/cdrom1' ], + "diskdevice": ['/dev/vdc', '/dev/vdb', '/dev/hdb', '/dev/hdc', '/dev/xvdd', '/dev/cdrom', '/dev/sr0', '/dev/cdrom1' ], # Disk device where ISO is attached to instance "mount_dir": "/mnt/tmp", "sleep": 60, @@ -732,15 +732,6 @@ class TestVMLifeCycle(cloudstackTestCase): cmd.virtualmachineid = self.virtual_machine.id self.apiclient.attachIso(cmd) - #determine device type from hypervisor - hosts = Host.list(self.apiclient, id=self.virtual_machine.hostid) - self.assertTrue(isinstance(hosts, list)) - self.assertTrue(len(hosts) > 0) - self.debug("Found %s host" % hosts[0].hypervisor) - - if hosts[0].hypervisor.lower() == "kvm": - self.services["diskdevice"] = "/dev/vdb" - try: ssh_client = self.virtual_machine.get_ssh_client() except Exception as e: From b21de4006abd61512b027af2dd9e8b07df1dd06f Mon Sep 17 00:00:00 2001 From: Harikrishna Patnala Date: Sat, 27 Jul 2013 19:51:02 +0530 Subject: [PATCH 4/5] CLOUDSTACK-3703: change service offering of stopped vm on --- server/src/com/cloud/vm/UserVmManagerImpl.java | 7 ++++--- server/test/com/cloud/vm/UserVmManagerTest.java | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index a60412d41e6..3831f88f21e 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -1144,15 +1144,16 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use // Verify input parameters VMInstanceVO vmInstance = _vmInstanceDao.findById(vmId); - if(vmInstance.getHypervisorType() != HypervisorType.XenServer && vmInstance.getHypervisorType() != HypervisorType.VMware){ - throw new InvalidParameterValueException("This operation not permitted for this hypervisor of the vm"); - } if(vmInstance.getState().equals(State.Stopped)){ upgradeStoppedVirtualMachine(vmId, newServiceOfferingId); return true; } + if(vmInstance.getHypervisorType() != HypervisorType.XenServer && vmInstance.getHypervisorType() != HypervisorType.VMware){ + throw new InvalidParameterValueException("This operation not permitted for this hypervisor of the vm"); + } + _accountMgr.checkAccess(caller, null, true, vmInstance); // Check that the specified service offering ID is valid diff --git a/server/test/com/cloud/vm/UserVmManagerTest.java b/server/test/com/cloud/vm/UserVmManagerTest.java index 70a342246f5..2af0e70894e 100755 --- a/server/test/com/cloud/vm/UserVmManagerTest.java +++ b/server/test/com/cloud/vm/UserVmManagerTest.java @@ -272,7 +272,8 @@ public class UserVmManagerTest { // UserContext.current().setEventDetails("Vm Id: "+getId()); Account account = (Account) new AccountVO("testaccount", 1L, "networkdomain", (short) 0, "uuid"); //AccountVO(String accountName, long domainId, String networkDomain, short type, int regionId) - UserContext.registerContext(1, account, null, true); + doReturn(VirtualMachine.State.Running).when(_vmInstance).getState(); + UserContext.registerContext(1, account, null, true); when(_vmInstanceDao.findById(anyLong())).thenReturn(_vmInstance); From 93f79e1a158cb1f69915a4036f5c1840a38c5e53 Mon Sep 17 00:00:00 2001 From: Prasanna Santhanam Date: Sat, 27 Jul 2013 20:18:05 +0530 Subject: [PATCH 5/5] CLOUDSTACK-2882: We are mounting an ISO not a volume So fdisk -l doesn't list the mounted iso. Instead use showmount -e to find the mounted device. Signed-off-by: Prasanna Santhanam --- test/integration/smoke/test_vm_life_cycle.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integration/smoke/test_vm_life_cycle.py b/test/integration/smoke/test_vm_life_cycle.py index 7dab5cf26e7..8e5a8bbcdd7 100644 --- a/test/integration/smoke/test_vm_life_cycle.py +++ b/test/integration/smoke/test_vm_life_cycle.py @@ -749,7 +749,7 @@ class TestVMLifeCycle(cloudstackTestCase): else: self.skipTest("No mount points matched. Mount was unsuccessful") - c = "fdisk -l|grep %s|head -1" % self.services["mount"] + c = "mount |grep %s|head -1" % self.services["mount"] res = ssh_client.execute(c) self.debug("Found a mount point at %s" % res) @@ -775,7 +775,7 @@ class TestVMLifeCycle(cloudstackTestCase): self.assertEqual( str(iso_size) in result, True, - "Check size of the attached ISO" + "ISO size mismatch. reported size within guest %s" % str(iso_size) ) try: #Unmount ISO