Re: CentOS 6 xen-pv install from iso image

2,232 views
Skip to first unread message

Iustin Pop

unread,
Jul 21, 2012, 3:21:05 AM7/21/12
to gan...@googlegroups.com
On Fri, Jul 20, 2012 at 04:39:49PM -0700, Kevin Brooks wrote:
> I've got Ganeti 2.5.1 installed under Debian squeeze. I've successfully
> created Debian squeeze VMs using ganeti-instance-debootstrap and now I'd
> like to install a CentOS 6 VM with it's own /boot partition. I've poured
> over the docs and scoured the web but I can't seem to figure out how to
> install a CentOS 6.x based (pvops kernel) domU from the minimal centos 6
> install iso. I managed to install centos 6 into a qemu image but couldn't
> make ganeti-instance-image happy about using it. It complained about swap
> being on partition (disk) 2, which seems correct given the requirements
> outlined in the ganeti-instance-image README. Any pointers would be
> appreciated.

You don't mention what hypervisor are you using :)

So direct installation from an ISO is not supported for xen-pvm, but
should work for xen-hvm and kvm. For xen-pvm, one can achieve something
similar to CD-booting, but it's a bit more complex - you'd have to
extract the kernel and initrd used for booting…

iustin

Iustin Pop

unread,
Jul 21, 2012, 3:35:27 AM7/21/12
to gan...@googlegroups.com
On Sat, Jul 21, 2012 at 09:21:05AM +0200, Iustin Pop wrote:
> On Fri, Jul 20, 2012 at 04:39:49PM -0700, Kevin Brooks wrote:
> > I've got Ganeti 2.5.1 installed under Debian squeeze. I've successfully
> > created Debian squeeze VMs using ganeti-instance-debootstrap and now I'd
> > like to install a CentOS 6 VM with it's own /boot partition. I've poured
> > over the docs and scoured the web but I can't seem to figure out how to
> > install a CentOS 6.x based (pvops kernel) domU from the minimal centos 6
> > install iso. I managed to install centos 6 into a qemu image but couldn't
> > make ganeti-instance-image happy about using it. It complained about swap
> > being on partition (disk) 2, which seems correct given the requirements
> > outlined in the ganeti-instance-image README. Any pointers would be
> > appreciated.
>
> You don't mention what hypervisor are you using :)

Oops, you did, but in the subject line, and missed it. Sorry!

> So direct installation from an ISO is not supported for xen-pvm, but
> should work for xen-hvm and kvm. For xen-pvm, one can achieve something
> similar to CD-booting, but it's a bit more complex - you'd have to
> extract the kernel and initrd used for booting…

So yes, for xen-pv it's a bit harder. If you can extract vmlinuz/initrd
from the CDROM, then you can set those as kernel_path and initrd_path,
and then the install should work as-is.

regards,
iustin

insrc

unread,
Jul 21, 2012, 4:10:01 AM7/21/12
to gan...@googlegroups.com


On Sat, Jul 21, 2012 at 9:35 AM, Iustin Pop <iu...@k1024.org> wrote:
(...) 
So yes, for xen-pv it's a bit harder. If you can extract vmlinuz/initrd
from the CDROM,

Yep ! But instead of extracting the kernel (vmlinuz) and initrd (initrd.img) files, you can dowload them from the mirrors. 
For example, for a CentOS 6.x x86 install, just download them from http://ftp.free.fr/mirrors/ftp.centos.org/6.3/os/i386/images/pxeboot/

 
then you can set those as kernel_path and initrd_path,
and then the install should work as-is.


Yep ! Here is a quick step by step on how to that:
  1. download "vmlinuz" and "initrd.img" for a pxeboot install of centos from the mirrors and put them on the same path on all of your nodes.  
  2. Create an Ganeti XEN-PV instance:<code>
gnt-instance add --debug --disk-template drbd --os-type debootstrap+default --net 0:link=xen-br0 --disk 0:size=5G --backend-parameters memory=512   --hypervisor-parameters kernel_path=/boot/distributions/centos/6/x86_64/vmlinuz,initrd_path=/boot/distributions/centos/6/x86_64/initrd.img,kernel_args="console=hvc0" --no-install --no-start  --node gnt-node-1:gnt-node-2  gnt-instance-1
</code> 
   The important settings are the ''kernel_path'' and  ''initrd_path'' as Iustin pointed out but also the ''kernel_args'' options which tells to the CentOS installer to use XEN PV console (aka hvc0) as the serial console. 
  3. Start the instance: <code>
gnt-instance start gnt-instance-1
</code>
  4. connect to the instance console <code>
gnt-instance console gnt-instance-1 
</code>
  5. Voilà ! 
  You should be able  to proceed with a *normal* text-only CentOS Installation. Note that anaconda (the RHEL/centos/... installer) in text-only mode has less features then in graphical mode, like not allowing you to specify the partitions layout (see http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Migration_Planning_Guide/ch02s03.html
  NB: If you want access to the complete installer, you'll have to a graphical Xen-PV installation: see below

For a graphical CentOS XEN-PV installation, just:
  - at step 2, just add "vnc" to the kernel_args options: kernel_args="console=hvc0 vnc" . You can also add a "vncpassword" option to secure a bit the access to the installer iirc...
  - At step 4, connect to the instance console to get the ip and port on which anaconda is listening.
  Then start a  vnc client to connect to it from your desktop


@Iustin: Wish that some basic info for guest installation besides debian was there on the wiki, , especially XEN HVM installation (Windows, BSD*...) or XEN PV installation from CD/DVD for Linux instances. 
This is really not that evident for newcomers, especially for those  choosing the Xen hypervisor :-) 

HTH,
Thanks

ashish1099

unread,
Aug 30, 2012, 6:59:33 PM8/30/12
to gan...@googlegroups.com
Hi,

looking exactly for this one..
many thanks.. was hitting head on my laptop from last 3 hours

Anuj AJ

unread,
Apr 8, 2014, 7:20:52 PM4/8/14
to gan...@googlegroups.com
Hi there .. couple of questions about this. 

Iam trying to install Ubuntu 12.04 from ISO . My ganeti cluster is xen-pvm as well. 
through the read up ... please correct me if iam wrong. 

I would need a pxeboot server in my environment ? 

Would i need something else to make this work ?

Thanks
AJ

Thomas Thrainer

unread,
Apr 9, 2014, 2:56:32 AM4/9/14
to gan...@googlegroups.com
Hi,


On Wed, Apr 9, 2014 at 1:20 AM, Anuj AJ <anu...@outlook.com> wrote:
Hi there .. couple of questions about this. 

Iam trying to install Ubuntu 12.04 from ISO . My ganeti cluster is xen-pvm as well. 
through the read up ... please correct me if iam wrong. 

I would need a pxeboot server in my environment ? 

As far as I've understood, you don't need a pxeboot server. You just have to extract (or download) the kernel (vmlinuz) and the initial ramdisk (initrd.img) from the installation CD and pass them in the hypervisor parameters. You will also need to attach the installation CD to the instance, so the installation can access it.

The following hypervisor parameters should do the trick:

--hypervisor-parameters kernel_path=/path/to/vmlinuz,initrd_path=/path/to/initrd.img,kernel_args="console=hvc0",cdrom_image_path=/path/to/ubuntu_cdrom.iso

If you want to perform a graphical install, follow the steps regarding VNC in the mail you're referring to.

Cheers,
Thomas



--
Thomas Thrainer | Software Engineer | thom...@google.com | 

Google Germany GmbH
Dienerstr. 12
80331 München

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Graham Law, Christine Elizabeth Flores
Reply all
Reply to author
Forward
0 new messages