You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2015/12/14 11:39:50 UTC
[1/2] git commit: updated refs/heads/master to 2478414
Repository: cloudstack
Updated Branches:
refs/heads/master 7c83e1b24 -> 2478414d4
CLOUDSTACK-9127 Missing PV-bootloader-args for "SUSE Linux Enterprise Server 10 SP2 and SP3"
Added Unit test for the new method
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9ae3c0a5
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9ae3c0a5
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9ae3c0a5
Branch: refs/heads/master
Commit: 9ae3c0a5a9f3438e9714ddb8307a6835231bf583
Parents: 312b9af
Author: SudharmaJain <su...@citrix.com>
Authored: Wed Dec 9 11:53:51 2015 +0530
Committer: SudharmaJain <su...@citrix.com>
Committed: Mon Dec 14 11:26:45 2015 +0530
----------------------------------------------------------------------
.../xenserver/resource/CitrixHelper.java | 11 +++++++
.../xenserver/resource/CitrixResourceBase.java | 1 +
.../xenserver/resource/CitrixHelperTest.java | 34 ++++++++++++++++++++
3 files changed, 46 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ae3c0a5/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixHelper.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixHelper.java b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixHelper.java
index 265573d..cf2bd76 100644
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixHelper.java
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixHelper.java
@@ -236,4 +236,15 @@ public class CitrixHelper {
}
return prodVersion;
}
+
+ public static String getPVbootloaderArgs(String guestOS) {
+ if (guestOS.startsWith("SUSE Linux Enterprise Server")) {
+ if (guestOS.contains("64-bit")) {
+ return "--kernel /boot/vmlinuz-xen --ramdisk /boot/initrd-xen";
+ } else if (guestOS.contains("32-bit")) {
+ return "--kernel /boot/vmlinuz-xenpae --ramdisk /boot/initrd-xenpae";
+ }
+ }
+ return "";
+ }
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ae3c0a5/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
index e1f7d3d..7c8bca7 100644
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
@@ -1352,6 +1352,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
}
} else if (vmSpec.getBootloader() == BootloaderType.PyGrub) {
vm.setPVBootloader(conn, "pygrub");
+ vm.setPVBootloaderArgs(conn,CitrixHelper.getPVbootloaderArgs(guestOsTypeName));
} else {
vm.destroy(conn);
throw new CloudRuntimeException("Unable to handle boot loader type: " + vmSpec.getBootloader());
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9ae3c0a5/plugins/hypervisors/xenserver/test/com/cloud/hypervisor/xenserver/resource/CitrixHelperTest.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/test/com/cloud/hypervisor/xenserver/resource/CitrixHelperTest.java b/plugins/hypervisors/xenserver/test/com/cloud/hypervisor/xenserver/resource/CitrixHelperTest.java
new file mode 100644
index 0000000..b656ec3
--- /dev/null
+++ b/plugins/hypervisors/xenserver/test/com/cloud/hypervisor/xenserver/resource/CitrixHelperTest.java
@@ -0,0 +1,34 @@
+package com.cloud.hypervisor.xenserver.resource;
+
+import junit.framework.Assert;
+import org.junit.Test;
+
+
+/**
+ * Created by ajna123 on 12/11/2015.
+ */
+public class CitrixHelperTest {
+
+ @Test
+ public void testGetPVbootloaderArgs() throws Exception {
+
+ String os_name_Suse10Sp2_64 = "SUSE Linux Enterprise Server 10 SP2 (64-bit)";
+ String os_name_Suse10Sp2_32 = "SUSE Linux Enterprise Server 10 SP2 (32-bit)";
+ String os_name_Suse11Sp3_64 = "SUSE Linux Enterprise Server 11 SP3 (64-bit)";
+ String os_name_Suse11Sp3_32 = "SUSE Linux Enterprise Server 11 SP3 (32-bit)";
+
+ String os_name_Windows8_64 = "Windows 8 (64-bit)";
+ String os_name_Windows8_32 = "Windows 8 (32-bit)";
+
+ String pvBootLoaderArgs_32 = "--kernel /boot/vmlinuz-xenpae --ramdisk /boot/initrd-xenpae";
+ String pvBootLoaderArgs_64 = "--kernel /boot/vmlinuz-xen --ramdisk /boot/initrd-xen";
+
+ Assert.assertEquals(CitrixHelper.getPVbootloaderArgs(os_name_Suse10Sp2_32), pvBootLoaderArgs_32);
+ Assert.assertEquals(CitrixHelper.getPVbootloaderArgs(os_name_Suse10Sp2_64),pvBootLoaderArgs_64);
+ Assert.assertEquals(CitrixHelper.getPVbootloaderArgs(os_name_Suse11Sp3_32),pvBootLoaderArgs_32);
+ Assert.assertEquals(CitrixHelper.getPVbootloaderArgs(os_name_Suse11Sp3_64),pvBootLoaderArgs_64);
+
+ Assert.assertEquals(CitrixHelper.getPVbootloaderArgs(os_name_Windows8_32),"");
+ Assert.assertEquals(CitrixHelper.getPVbootloaderArgs(os_name_Windows8_64),"");
+ }
+}
\ No newline at end of file
[2/2] git commit: updated refs/heads/master to 2478414
Posted by da...@apache.org.
Merge pull request #1196 from SudharmaJain/cs-9127
CLOUDSTACK-9127 Missing PV-bootloader-args for "SUSE Linux Enterprise Server 10 SP2 and SP3"
ISSUE
--------
STOP-START of SUSE Linux VMs fail, as PV-bootloader-args are missing during the start command.
DESCRIPTION
----------------------
Repro steps
1. Upload Suse ISO
2. Create a VM with this ISO, and install it.
3. Detach ISO from the VM.
4. Reboot the VM, :>>>> This will work fine, as the pv-bootloader-args are not missing during reboot.
5.Stop the VM from CCP(VM will get destroyed in Xencenter)
6. Start the same VM from CCP , it will try to start but will fail.
Before Applying the fix
--------------------------------
Before applying the starting the VM failed with following exception
com.cloud.utils.exception.CloudRuntimeException: Unable to start VM(i-2-6-VM) on host(7cfd6388-b763-4c09-b3a3-9679db2904a3) due to Task failed! Task record: uuid: 21a6799f-9523-7c0e-bb86-1de750a38d74
nameLabel: Async.VM.start_on
nameDescription:
allowedOperations: []
currentOperations: {}
created: Wed Dec 09 07:00:29 UTC 2015
finished: Wed Dec 09 07:00:31 UTC 2015
status: failure
residentOn: com.xensource.xenapi.Host@513d238c
progress: 1.0
type: <none/>
result:
errorInfo: [BOOTLOADER_FAILED, OpaqueRef:0b10b6ac-837d-29af-da9d-6ef1e11a064a, Unable to find partition containing kernel
]
otherConfig: {}
subtaskOf: com.xensource.xenapi.Task@aaf13f6f
subtasks: []
![image](https://cloud.githubusercontent.com/assets/12229259/11678758/bd0fc9aa-9e70-11e5-9687-c77bfecaa4dd.png)
After Applying the fix
--------------------------
After applying the fix I am able to start the vm.
![image](https://cloud.githubusercontent.com/assets/12229259/11678938/6d44f5b0-9e72-11e5-83b0-60a736408b4d.png)
* pr/1196:
CLOUDSTACK-9127 Missing PV-bootloader-args for "SUSE Linux Enterprise Server 10 SP2 and SP3"
Signed-off-by: Daan Hoogland <da...@onecht.net>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/2478414d
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/2478414d
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/2478414d
Branch: refs/heads/master
Commit: 2478414d471f6f72ff8c696ffc1c9b80b65766a1
Parents: 7c83e1b 9ae3c0a
Author: Daan Hoogland <da...@onecht.net>
Authored: Mon Dec 14 11:39:31 2015 +0100
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Dec 14 11:39:32 2015 +0100
----------------------------------------------------------------------
.../xenserver/resource/CitrixHelper.java | 11 +++++++
.../xenserver/resource/CitrixResourceBase.java | 1 +
.../xenserver/resource/CitrixHelperTest.java | 34 ++++++++++++++++++++
3 files changed, 46 insertions(+)
----------------------------------------------------------------------