UEC: Hacks: Difference between revisions

From OnnoCenterWiki
Jump to navigationJump to search
Onnowpurbo (talk | contribs)
New page: Bringing up a windows instance without using kernel and ramdisk images Edit /usr/share/eucalyptus/gen_kvm_libvirt_xml to remove the lines that add “-kernel” and “-initrd” options...
 
Onnowpurbo (talk | contribs)
No edit summary
Line 5: Line 5:
Here is the patch for /usr/share/eucalyptus/gen_kvm_libvirt_xml that ships with Ubuntu 10.04 (Lucid Lynx)
Here is the patch for /usr/share/eucalyptus/gen_kvm_libvirt_xml that ships with Ubuntu 10.04 (Lucid Lynx)
DISCLAIMER: This patch works  with the windows instances  on Lucid Lynx. This would work as long as all your disk images are bootable and you don’t need the kernel and ramdisk images. If you need the flexibility of launching instances using different kernel/ramdisk combinations, this hack is not for you!
DISCLAIMER: This patch works  with the windows instances  on Lucid Lynx. This would work as long as all your disk images are bootable and you don’t need the kernel and ramdisk images. If you need the flexibility of launching instances using different kernel/ramdisk combinations, this hack is not for you!
view source
print?
01 --- /usr/share/eucalyptus/gen_kvm_libvirt_xml
02 +++ gen_kvm_libvirt_xml.modified
03 @@ -75,7 +75,7 @@
04 our $use_ramdisk = 0;
05
06 # deal with command-line parameters
07 -GetOptions('ramdisk'        => sub { $use_ramdisk = 1; },
08 +GetOptions('ramdisk'        => sub { $use_ramdisk = 0; },
09             'ephemeral'      => sub { }, # option ignored
10                   ) or exit (1);
11
12 @@ -84,7 +84,6 @@
13     <name>NAME</name>
14     <os>
15     <type>hvm</type>
16 -        <kernel>BASEPATH/kernel</kernel>
17 EOF
18
19 if ( $use_ramdisk ) {
20 @@ -92,7 +91,6 @@
21 }
22
23 print <<EOF;
24 -        <cmdline>root=/dev/sda1 console=ttyS0</cmdline>
25     </os>
26     <features>
27         <acpi/>


--- /usr/share/eucalyptus/gen_kvm_libvirt_xml
+++ gen_kvm_libvirt_xml.modified
@@ -75,7 +75,7 @@
our $use_ramdisk = 0;
# deal with command-line parameters
-GetOptions('ramdisk'        => sub { $use_ramdisk = 1; },
+GetOptions('ramdisk'        => sub { $use_ramdisk = 0; },
            'ephemeral'      => sub { }, # option ignored
                  ) or exit (1);
@@ -84,7 +84,6 @@
    <name>NAME</name>
    <os>
    <type>hvm</type>
-        <kernel>BASEPATH/kernel</kernel>
EOF
if ( $use_ramdisk ) {
@@ -92,7 +91,6 @@
}
print <<EOF;
-        <cmdline>root=/dev/sda1 console=ttyS0</cmdline>
    </os>
    <features>
        <acpi/>


==Referensi==
==Referensi==

Revision as of 21:46, 21 October 2010

Bringing up a windows instance without using kernel and ramdisk images

Edit /usr/share/eucalyptus/gen_kvm_libvirt_xml to remove the lines that add “-kernel” and “-initrd” options in the libvirt.xml.

Here is the patch for /usr/share/eucalyptus/gen_kvm_libvirt_xml that ships with Ubuntu 10.04 (Lucid Lynx) DISCLAIMER: This patch works with the windows instances on Lucid Lynx. This would work as long as all your disk images are bootable and you don’t need the kernel and ramdisk images. If you need the flexibility of launching instances using different kernel/ramdisk combinations, this hack is not for you!

--- /usr/share/eucalyptus/gen_kvm_libvirt_xml +++ gen_kvm_libvirt_xml.modified @@ -75,7 +75,7 @@ our $use_ramdisk = 0;

# deal with command-line parameters -GetOptions('ramdisk' => sub { $use_ramdisk = 1; }, +GetOptions('ramdisk' => sub { $use_ramdisk = 0; }, 'ephemeral' => sub { }, # option ignored ) or exit (1);

@@ -84,7 +84,6 @@ <name>NAME</name> <os> <type>hvm</type> - <kernel>BASEPATH/kernel</kernel> EOF

if ( $use_ramdisk ) { @@ -92,7 +91,6 @@ }

print <<EOF; - <cmdline>root=/dev/sda1 console=ttyS0</cmdline> </os> <features> <acpi/>

Referensi

Pranala Menarik