Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: OpenStack: Operators

CentOS Image

 

 

First page Previous page 1 2 Next page Last page  View All OpenStack operators RSS feed   Index | Next | Previous | View Threaded


jacobgodin at gmail

Apr 5, 2013, 8:23 AM

Post #1 of 27 (806 views)
Permalink
CentOS Image

Hi all,

I have created a CentOS image using the AMI + AKI + ARI method (same as I
used to create my Ubuntu images). I am able to successfully upload and
launch the image at first. When trying to launch the third+ instances, they
simply get stuck in a bootloop after the 'Booting from ROM...'.

Even if I delete the original two images, I am unable to boot. The only way
to get a CentOS image to successfully boot is to re-upload the image.

Any ideas? I'm using Folsom w/ Ceph RBD storage for images, and CephFS for
instances.


alopgeek at gmail

Apr 6, 2013, 8:53 AM

Post #2 of 27 (798 views)
Permalink
Re: CentOS Image [In reply to]

Is it safe to assume that you don't have this problem with your Ubuntu
images?

On Friday, April 5, 2013, Jacob Godin wrote:

> Hi all,
>
> I have created a CentOS image using the AMI + AKI + ARI method (same as I
> used to create my Ubuntu images). I am able to successfully upload and
> launch the image at first. When trying to launch the third+ instances, they
> simply get stuck in a bootloop after the 'Booting from ROM...'.
>
> Even if I delete the original two images, I am unable to boot. The only
> way to get a CentOS image to successfully boot is to re-upload the image.
>
> Any ideas? I'm using Folsom w/ Ceph RBD storage for images, and CephFS for
> instances.
>


lorin at nimbisservices

Apr 6, 2013, 8:58 AM

Post #3 of 27 (802 views)
Permalink
Re: CentOS Image [In reply to]

Out of curiosity, why did you decide to create AMI/ARI/AKI format images instead of qcow2? Curious because I thought that was a legacy thing that nobody did anymore. 
—
Sent from Mailbox for iPhone

On Fri, Apr 5, 2013 at 11:32 AM, Jacob Godin <jacobgodin [at] gmail> wrote:

> Hi all,
> I have created a CentOS image using the AMI + AKI + ARI method (same as I
> used to create my Ubuntu images). I am able to successfully upload and
> launch the image at first. When trying to launch the third+ instances, they
> simply get stuck in a bootloop after the 'Booting from ROM...'.
> Even if I delete the original two images, I am unable to boot. The only way
> to get a CentOS image to successfully boot is to re-upload the image.
> Any ideas? I'm using Folsom w/ Ceph RBD storage for images, and CephFS for
> instances.


jacobgodin at gmail

Apr 6, 2013, 12:05 PM

Post #4 of 27 (797 views)
Permalink
Re: CentOS Image [In reply to]

Hi Lorin,

It was my understanding that this was the way to have a dynamic root disk.
So I can have, say, a 5GB instance and a 100GB instance use the same image,
rather than limiting the size root FS and giving the rest as ephemeral
storage.

@Abel: Ubuntu images work just fine



On Sat, Apr 6, 2013 at 12:58 PM, Lorin Hochstein
<lorin [at] nimbisservices>wrote:

> Out of curiosity, why did you decide to create AMI/ARI/AKI format images
> instead of qcow2? Curious because I thought that was a legacy thing that
> nobody did anymore.
> —
> Sent from Mailbox <https://bit.ly/SZvoJe> for iPhone
>
>
> On Fri, Apr 5, 2013 at 11:32 AM, Jacob Godin <jacobgodin [at] gmail> wrote:
>
>> Hi all,
>>
>> I have created a CentOS image using the AMI + AKI + ARI method (same as I
>> used to create my Ubuntu images). I am able to successfully upload and
>> launch the image at first. When trying to launch the third+ instances, they
>> simply get stuck in a bootloop after the 'Booting from ROM...'.
>>
>> Even if I delete the original two images, I am unable to boot. The only
>> way to get a CentOS image to successfully boot is to re-upload the image.
>>
>> Any ideas? I'm using Folsom w/ Ceph RBD storage for images, and CephFS
>> for instances.
>>
>
>


lorin at nimbisservices

Apr 6, 2013, 1:18 PM

Post #5 of 27 (799 views)
Permalink
Re: CentOS Image [In reply to]

Jacob:

You can configure a raw or qcow2 image to resize on boot so it uses the
entire primary root disk. See the "Support resizing" section of the
OpenStack Compute Admin guide for more details:

http://docs.openstack.org/folsom/openstack-compute/admin/content/image-customizing-what-you-need-to-know.html#support-resizing

I believe that if cloud-init is installed, it will resize the root
partition for you by default, although I haven't tested this myself. For
CentOS images, you can install cloud-init from EPEL.

Lorin


On Sat, Apr 6, 2013 at 3:05 PM, Jacob Godin <jacobgodin [at] gmail> wrote:

> Hi Lorin,
>
> It was my understanding that this was the way to have a dynamic root disk.
> So I can have, say, a 5GB instance and a 100GB instance use the same image,
> rather than limiting the size root FS and giving the rest as ephemeral
> storage.
>
> @Abel: Ubuntu images work just fine
>
>
>
> On Sat, Apr 6, 2013 at 12:58 PM, Lorin Hochstein <lorin [at] nimbisservices
> > wrote:
>
>> Out of curiosity, why did you decide to create AMI/ARI/AKI format images
>> instead of qcow2? Curious because I thought that was a legacy thing that
>> nobody did anymore.
>> —
>> Sent from Mailbox <https://bit.ly/SZvoJe> for iPhone
>>
>>
>> On Fri, Apr 5, 2013 at 11:32 AM, Jacob Godin <jacobgodin [at] gmail>wrote:
>>
>>> Hi all,
>>>
>>> I have created a CentOS image using the AMI + AKI + ARI method (same as
>>> I used to create my Ubuntu images). I am able to successfully upload and
>>> launch the image at first. When trying to launch the third+ instances, they
>>> simply get stuck in a bootloop after the 'Booting from ROM...'.
>>>
>>> Even if I delete the original two images, I am unable to boot. The only
>>> way to get a CentOS image to successfully boot is to re-upload the image.
>>>
>>> Any ideas? I'm using Folsom w/ Ceph RBD storage for images, and CephFS
>>> for instances.
>>>
>>
>>
>


--
Lorin Hochstein
Lead Architect - Cloud Services
Nimbis Services, Inc.
www.nimbisservices.com


jacobgodin at gmail

Apr 7, 2013, 3:23 PM

Post #6 of 27 (786 views)
Permalink
Re: CentOS Image [In reply to]

Great, that seems to be exactly what I need! Thanks Lorin


On Sat, Apr 6, 2013 at 5:18 PM, Lorin Hochstein <lorin [at] nimbisservices>wrote:

> Jacob:
>
> You can configure a raw or qcow2 image to resize on boot so it uses the
> entire primary root disk. See the "Support resizing" section of the
> OpenStack Compute Admin guide for more details:
>
>
> http://docs.openstack.org/folsom/openstack-compute/admin/content/image-customizing-what-you-need-to-know.html#support-resizing
>
> I believe that if cloud-init is installed, it will resize the root
> partition for you by default, although I haven't tested this myself. For
> CentOS images, you can install cloud-init from EPEL.
>
> Lorin
>
>
> On Sat, Apr 6, 2013 at 3:05 PM, Jacob Godin <jacobgodin [at] gmail> wrote:
>
>> Hi Lorin,
>>
>> It was my understanding that this was the way to have a dynamic root
>> disk. So I can have, say, a 5GB instance and a 100GB instance use the same
>> image, rather than limiting the size root FS and giving the rest as
>> ephemeral storage.
>>
>> @Abel: Ubuntu images work just fine
>>
>>
>>
>> On Sat, Apr 6, 2013 at 12:58 PM, Lorin Hochstein <
>> lorin [at] nimbisservices> wrote:
>>
>>> Out of curiosity, why did you decide to create AMI/ARI/AKI format images
>>> instead of qcow2? Curious because I thought that was a legacy thing that
>>> nobody did anymore.
>>> —
>>> Sent from Mailbox <https://bit.ly/SZvoJe> for iPhone
>>>
>>>
>>> On Fri, Apr 5, 2013 at 11:32 AM, Jacob Godin <jacobgodin [at] gmail>wrote:
>>>
>>>> Hi all,
>>>>
>>>> I have created a CentOS image using the AMI + AKI + ARI method (same as
>>>> I used to create my Ubuntu images). I am able to successfully upload and
>>>> launch the image at first. When trying to launch the third+ instances, they
>>>> simply get stuck in a bootloop after the 'Booting from ROM...'.
>>>>
>>>> Even if I delete the original two images, I am unable to boot. The only
>>>> way to get a CentOS image to successfully boot is to re-upload the image.
>>>>
>>>> Any ideas? I'm using Folsom w/ Ceph RBD storage for images, and CephFS
>>>> for instances.
>>>>
>>>
>>>
>>
>
>
> --
> Lorin Hochstein
> Lead Architect - Cloud Services
> Nimbis Services, Inc.
> www.nimbisservices.com
>


jacobgodin at gmail

Apr 10, 2013, 5:17 AM

Post #7 of 27 (796 views)
Permalink
Re: CentOS Image [In reply to]

Just a follow up on this thread for any future Googlers, cloud-init from
EPEL does not actually perform this task for you. With Ubuntu you can use
growpart from cloud-utils. However, at this time, cloud-utils is not
available for CentOS.

The best way to accomplish this is to customize the ramdisk in the image to
resize the partition and filesystem on boot. I used the following tutorials
during this process:
https://thunked.org/stefan/howto-shrink-remote-root-filesystem
http://www.landley.net/writing/rootfs-programming.html

You will want to import the following binaries (and lib dependencies):
e2fsck
fdisk (or another partition table editor)
resize2fs
partprobe

Here is what my (very basic) re-sizing looks like (sysadmins, hide your
eyes):
/sbin/e2fsck -p -f /dev/vda1 1>/dev/null
echo -n "Resizing root partition...."
(echo "d 1"; echo n; echo p; echo 1; echo ; echo ; echo w) | /sbin/fdisk
/dev/vda &>/dev/null
echo " complete."
/sbin/partprobe
/sbin/e2fsck -p -f /dev/vda1 1>/dev/null
echo -n "Resizing root filesystem...."
/sbin/resize2fs /dev/vda1 1>/dev/null
echo " complete."



On Sun, Apr 7, 2013 at 7:23 PM, Jacob Godin <jacobgodin [at] gmail> wrote:

> Great, that seems to be exactly what I need! Thanks Lorin
>
>
> On Sat, Apr 6, 2013 at 5:18 PM, Lorin Hochstein <lorin [at] nimbisservices>wrote:
>
>> Jacob:
>>
>> You can configure a raw or qcow2 image to resize on boot so it uses the
>> entire primary root disk. See the "Support resizing" section of the
>> OpenStack Compute Admin guide for more details:
>>
>>
>> http://docs.openstack.org/folsom/openstack-compute/admin/content/image-customizing-what-you-need-to-know.html#support-resizing
>>
>> I believe that if cloud-init is installed, it will resize the root
>> partition for you by default, although I haven't tested this myself. For
>> CentOS images, you can install cloud-init from EPEL.
>>
>> Lorin
>>
>>
>> On Sat, Apr 6, 2013 at 3:05 PM, Jacob Godin <jacobgodin [at] gmail> wrote:
>>
>>> Hi Lorin,
>>>
>>> It was my understanding that this was the way to have a dynamic root
>>> disk. So I can have, say, a 5GB instance and a 100GB instance use the same
>>> image, rather than limiting the size root FS and giving the rest as
>>> ephemeral storage.
>>>
>>> @Abel: Ubuntu images work just fine
>>>
>>>
>>>
>>> On Sat, Apr 6, 2013 at 12:58 PM, Lorin Hochstein <
>>> lorin [at] nimbisservices> wrote:
>>>
>>>> Out of curiosity, why did you decide to create AMI/ARI/AKI format
>>>> images instead of qcow2? Curious because I thought that was a legacy thing
>>>> that nobody did anymore.
>>>> —
>>>> Sent from Mailbox <https://bit.ly/SZvoJe> for iPhone
>>>>
>>>>
>>>> On Fri, Apr 5, 2013 at 11:32 AM, Jacob Godin <jacobgodin [at] gmail>wrote:
>>>>
>>>>> Hi all,
>>>>>
>>>>> I have created a CentOS image using the AMI + AKI + ARI method (same
>>>>> as I used to create my Ubuntu images). I am able to successfully upload and
>>>>> launch the image at first. When trying to launch the third+ instances, they
>>>>> simply get stuck in a bootloop after the 'Booting from ROM...'.
>>>>>
>>>>> Even if I delete the original two images, I am unable to boot. The
>>>>> only way to get a CentOS image to successfully boot is to re-upload the
>>>>> image.
>>>>>
>>>>> Any ideas? I'm using Folsom w/ Ceph RBD storage for images, and CephFS
>>>>> for instances.
>>>>>
>>>>
>>>>
>>>
>>
>>
>> --
>> Lorin Hochstein
>> Lead Architect - Cloud Services
>> Nimbis Services, Inc.
>> www.nimbisservices.com
>>
>
>


lorin at nimbisservices

Apr 10, 2013, 7:40 PM

Post #8 of 27 (792 views)
Permalink
Re: CentOS Image [In reply to]

Jacob:

I believe cloud-utils is on the way to EPEL, if it's not there yet (it's a
little hard for me to follow the package lifecycle):

https://bugzilla.redhat.com/show_bug.cgi?id=907756
https://admin.fedoraproject.org/updates/cloud-utils-0.27-3.el6
http://koji.fedoraproject.org/koji/packageinfo?packageID=15529


Lorin


On Wed, Apr 10, 2013 at 8:17 AM, Jacob Godin <jacobgodin [at] gmail> wrote:

> Just a follow up on this thread for any future Googlers, cloud-init from
> EPEL does not actually perform this task for you. With Ubuntu you can use
> growpart from cloud-utils. However, at this time, cloud-utils is not
> available for CentOS.
>
> The best way to accomplish this is to customize the ramdisk in the image
> to resize the partition and filesystem on boot. I used the following
> tutorials during this process:
> https://thunked.org/stefan/howto-shrink-remote-root-filesystem
> http://www.landley.net/writing/rootfs-programming.html
>
> You will want to import the following binaries (and lib dependencies):
> e2fsck
> fdisk (or another partition table editor)
> resize2fs
> partprobe
>
> Here is what my (very basic) re-sizing looks like (sysadmins, hide your
> eyes):
> /sbin/e2fsck -p -f /dev/vda1 1>/dev/null
> echo -n "Resizing root partition...."
> (echo "d 1"; echo n; echo p; echo 1; echo ; echo ; echo w) | /sbin/fdisk
> /dev/vda &>/dev/null
> echo " complete."
> /sbin/partprobe
> /sbin/e2fsck -p -f /dev/vda1 1>/dev/null
> echo -n "Resizing root filesystem...."
> /sbin/resize2fs /dev/vda1 1>/dev/null
> echo " complete."
>
>
>
> On Sun, Apr 7, 2013 at 7:23 PM, Jacob Godin <jacobgodin [at] gmail> wrote:
>
>> Great, that seems to be exactly what I need! Thanks Lorin
>>
>>
>> On Sat, Apr 6, 2013 at 5:18 PM, Lorin Hochstein <lorin [at] nimbisservices
>> > wrote:
>>
>>> Jacob:
>>>
>>> You can configure a raw or qcow2 image to resize on boot so it uses the
>>> entire primary root disk. See the "Support resizing" section of the
>>> OpenStack Compute Admin guide for more details:
>>>
>>>
>>> http://docs.openstack.org/folsom/openstack-compute/admin/content/image-customizing-what-you-need-to-know.html#support-resizing
>>>
>>> I believe that if cloud-init is installed, it will resize the root
>>> partition for you by default, although I haven't tested this myself. For
>>> CentOS images, you can install cloud-init from EPEL.
>>>
>>> Lorin
>>>
>>>
>>> On Sat, Apr 6, 2013 at 3:05 PM, Jacob Godin <jacobgodin [at] gmail>wrote:
>>>
>>>> Hi Lorin,
>>>>
>>>> It was my understanding that this was the way to have a dynamic root
>>>> disk. So I can have, say, a 5GB instance and a 100GB instance use the same
>>>> image, rather than limiting the size root FS and giving the rest as
>>>> ephemeral storage.
>>>>
>>>> @Abel: Ubuntu images work just fine
>>>>
>>>>
>>>>
>>>> On Sat, Apr 6, 2013 at 12:58 PM, Lorin Hochstein <
>>>> lorin [at] nimbisservices> wrote:
>>>>
>>>>> Out of curiosity, why did you decide to create AMI/ARI/AKI format
>>>>> images instead of qcow2? Curious because I thought that was a legacy thing
>>>>> that nobody did anymore.
>>>>> —
>>>>> Sent from Mailbox <https://bit.ly/SZvoJe> for iPhone
>>>>>
>>>>>
>>>>> On Fri, Apr 5, 2013 at 11:32 AM, Jacob Godin <jacobgodin [at] gmail>wrote:
>>>>>
>>>>>> Hi all,
>>>>>>
>>>>>> I have created a CentOS image using the AMI + AKI + ARI method (same
>>>>>> as I used to create my Ubuntu images). I am able to successfully upload and
>>>>>> launch the image at first. When trying to launch the third+ instances, they
>>>>>> simply get stuck in a bootloop after the 'Booting from ROM...'.
>>>>>>
>>>>>> Even if I delete the original two images, I am unable to boot. The
>>>>>> only way to get a CentOS image to successfully boot is to re-upload the
>>>>>> image.
>>>>>>
>>>>>> Any ideas? I'm using Folsom w/ Ceph RBD storage for images, and
>>>>>> CephFS for instances.
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>> --
>>> Lorin Hochstein
>>> Lead Architect - Cloud Services
>>> Nimbis Services, Inc.
>>> www.nimbisservices.com
>>>
>>
>>
>


--
Lorin Hochstein
Lead Architect - Cloud Services
Nimbis Services, Inc.
www.nimbisservices.com


robert.plestenjak at xlab

Jun 7, 2013, 2:09 AM

Post #9 of 27 (489 views)
Permalink
Re: CentOS image [In reply to]

Made some clean up and corrected wrong assumption for Grub boot partition

This util should work on anything that is based on CentOS 6

- Robert

----- Original Message -----
From: "Abel Lopez" <alopgeek [at] gmail>
To: "Sylvain Bauza" <sylvain.bauza [at] digimind>
Cc: "Robert Plestenjak" <robert.plestenjak [at] xlab>, openstack-operators [at] lists
Sent: Thursday, May 16, 2013 4:46:27 PM
Subject: Re: [Openstack-operators] CentOS image

Can this script work with images created with boxgrinder?

On Thursday, May 16, 2013, Sylvain Bauza wrote:


That's great tool ! Loving it, but need to test ;-)

-Sylvain

Le 16/05/2013 11:08, Robert Plestenjak a écrit :


This script will modify initrd for image resize during boot, redirect boot log messages to ttyS0 and set NOOP sceduler. Tested on CentOS 6.3 and 6.4.

https://github.com/flegmatik/ centos-image-resize

______________________________ _________________
OpenStack-operators mailing list
OpenStack-operators [at] lists
http://lists.openstack.org/ cgi-bin/mailman/listinfo/ openstack-operators


______________________________ _________________
OpenStack-operators mailing list
OpenStack-operators [at] lists
http://lists.openstack.org/ cgi-bin/mailman/listinfo/ openstack-operators

_______________________________________________
OpenStack-operators mailing list
OpenStack-operators [at] lists
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators


joe.topjian at cybera

Jun 10, 2013, 8:12 AM

Post #10 of 27 (463 views)
Permalink
Re: CentOS image [In reply to]

Is there a CentOS 6 image that has this script integrated available for
download?


On Fri, Jun 7, 2013 at 3:09 AM, Robert Plestenjak <robert.plestenjak [at] xlab
> wrote:

> Made some clean up and corrected wrong assumption for Grub boot partition
>
> This util should work on anything that is based on CentOS 6
>
> - Robert
>
> ----- Original Message -----
> From: "Abel Lopez" <alopgeek [at] gmail>
> To: "Sylvain Bauza" <sylvain.bauza [at] digimind>
> Cc: "Robert Plestenjak" <robert.plestenjak [at] xlab>,
> openstack-operators [at] lists
> Sent: Thursday, May 16, 2013 4:46:27 PM
> Subject: Re: [Openstack-operators] CentOS image
>
> Can this script work with images created with boxgrinder?
>
> On Thursday, May 16, 2013, Sylvain Bauza wrote:
>
>
> That's great tool ! Loving it, but need to test ;-)
>
> -Sylvain
>
> Le 16/05/2013 11:08, Robert Plestenjak a écrit :
>
>
> This script will modify initrd for image resize during boot, redirect boot
> log messages to ttyS0 and set NOOP sceduler. Tested on CentOS 6.3 and 6.4.
>
> https://github.com/flegmatik/ centos-image-resize
>
> ______________________________ _________________
> OpenStack-operators mailing list
> OpenStack-operators [at] lists
> http://lists.openstack.org/ cgi-bin/mailman/listinfo/ openstack-operators
>
>
> ______________________________ _________________
> OpenStack-operators mailing list
> OpenStack-operators [at] lists
> http://lists.openstack.org/ cgi-bin/mailman/listinfo/ openstack-operators
>
> _______________________________________________
> OpenStack-operators mailing list
> OpenStack-operators [at] lists
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>



--
Joe Topjian
Systems Architect
Cybera Inc.

www.cybera.ca

Cybera is a not-for-profit organization that works to spur and support
innovation, for the economic benefit of Alberta, through the use
of cyberinfrastructure.


razique.mahroua at gmail

Jun 10, 2013, 10:31 AM

Post #11 of 27 (463 views)
Permalink
Re: CentOS image [In reply to]

No sure, but you can create yours based on these images I'd say:

https://github.com/rackerjoe/oz-image-build


Razique Mahroua - Nuage & Co
razique.mahroua [at] gmail
Tel : +33 9 72 37 94 15



Le 10 juin 2013 à 17:12, Joe Topjian <joe.topjian [at] cybera> a écrit :

> Is there a CentOS 6 image that has this script integrated available for download?
>
>
> On Fri, Jun 7, 2013 at 3:09 AM, Robert Plestenjak <robert.plestenjak [at] xlab> wrote:
> Made some clean up and corrected wrong assumption for Grub boot partition
>
> This util should work on anything that is based on CentOS 6
>
> - Robert
>
> ----- Original Message -----
> From: "Abel Lopez" <alopgeek [at] gmail>
> To: "Sylvain Bauza" <sylvain.bauza [at] digimind>
> Cc: "Robert Plestenjak" <robert.plestenjak [at] xlab>, openstack-operators [at] lists
> Sent: Thursday, May 16, 2013 4:46:27 PM
> Subject: Re: [Openstack-operators] CentOS image
>
> Can this script work with images created with boxgrinder?
>
> On Thursday, May 16, 2013, Sylvain Bauza wrote:
>
>
> That's great tool ! Loving it, but need to test ;-)
>
> -Sylvain
>
> Le 16/05/2013 11:08, Robert Plestenjak a écrit :
>
>
> This script will modify initrd for image resize during boot, redirect boot log messages to ttyS0 and set NOOP sceduler. Tested on CentOS 6.3 and 6.4.
>
> https://github.com/flegmatik/ centos-image-resize
>
> ______________________________ _________________
> OpenStack-operators mailing list
> OpenStack-operators [at] lists
> http://lists.openstack.org/ cgi-bin/mailman/listinfo/ openstack-operators
>
>
> ______________________________ _________________
> OpenStack-operators mailing list
> OpenStack-operators [at] lists
> http://lists.openstack.org/ cgi-bin/mailman/listinfo/ openstack-operators
>
> _______________________________________________
> OpenStack-operators mailing list
> OpenStack-operators [at] lists
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>
>
>
> --
> Joe Topjian
> Systems Architect
> Cybera Inc.
>
> www.cybera.ca
>
> Cybera is a not-for-profit organization that works to spur and support innovation, for the economic benefit of Alberta, through the use of cyberinfrastructure.
> _______________________________________________
> OpenStack-operators mailing list
> OpenStack-operators [at] lists
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
Attachments: NUAGECO-LOGO-Fblan_petit.jpg (9.88 KB)


joe.topjian at cybera

Jun 10, 2013, 11:04 AM

Post #12 of 27 (462 views)
Permalink
Re: CentOS image [In reply to]

Indeed - that's probably what I'll end up doing. I was just wondering if
someone already did that work and could save me a few hours. :)


On Mon, Jun 10, 2013 at 11:31 AM, Razique Mahroua <razique.mahroua [at] gmail
> wrote:

> No sure, but you can create yours based on these images I'd say:
>
> https://github.com/rackerjoe/oz-image-build
>
>
> *Razique Mahroua** - **Nuage & Co*
> razique.mahroua [at] gmail
> Tel : +33 9 72 37 94 15
>
>
> Le 10 juin 2013 à 17:12, Joe Topjian <joe.topjian [at] cybera> a écrit :
>
> Is there a CentOS 6 image that has this script integrated available for
> download?
>
>
> On Fri, Jun 7, 2013 at 3:09 AM, Robert Plestenjak <
> robert.plestenjak [at] xlab> wrote:
>
>> Made some clean up and corrected wrong assumption for Grub boot partition
>>
>> This util should work on anything that is based on CentOS 6
>>
>> - Robert
>>
>> ----- Original Message -----
>> From: "Abel Lopez" <alopgeek [at] gmail>
>> To: "Sylvain Bauza" <sylvain.bauza [at] digimind>
>> Cc: "Robert Plestenjak" <robert.plestenjak [at] xlab>,
>> openstack-operators [at] lists
>> Sent: Thursday, May 16, 2013 4:46:27 PM
>> Subject: Re: [Openstack-operators] CentOS image
>>
>> Can this script work with images created with boxgrinder?
>>
>> On Thursday, May 16, 2013, Sylvain Bauza wrote:
>>
>>
>> That's great tool ! Loving it, but need to test ;-)
>>
>> -Sylvain
>>
>> Le 16/05/2013 11:08, Robert Plestenjak a écrit :
>>
>>
>> This script will modify initrd for image resize during boot, redirect
>> boot log messages to ttyS0 and set NOOP sceduler. Tested on CentOS 6.3 and
>> 6.4.
>>
>> https://github.com/flegmatik/ centos-image-resize
>>
>> ______________________________ _________________
>> OpenStack-operators mailing list
>> OpenStack-operators [at] lists
>> http://lists.openstack.org/ cgi-bin/mailman/listinfo/ openstack-operators
>>
>>
>> ______________________________ _________________
>> OpenStack-operators mailing list
>> OpenStack-operators [at] lists
>> http://lists.openstack.org/ cgi-bin/mailman/listinfo/ openstack-operators
>>
>> _______________________________________________
>> OpenStack-operators mailing list
>> OpenStack-operators [at] lists
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>>
>
>
>
> --
> Joe Topjian
> Systems Architect
> Cybera Inc.
>
> www.cybera.ca
>
> Cybera is a not-for-profit organization that works to spur and support
> innovation, for the economic benefit of Alberta, through the use
> of cyberinfrastructure.
> _______________________________________________
> OpenStack-operators mailing list
> OpenStack-operators [at] lists
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>
>
>


--
Joe Topjian
Systems Architect
Cybera Inc.

www.cybera.ca

Cybera is a not-for-profit organization that works to spur and support
innovation, for the economic benefit of Alberta, through the use
of cyberinfrastructure.
Attachments: NUAGECO-LOGO-Fblan_petit.jpg (9.88 KB)


robert.plestenjak at xlab

Jun 11, 2013, 2:35 AM

Post #13 of 27 (463 views)
Permalink
Re: CentOS image [In reply to]

Yes, that would be great.

You can also create image manually in KVM, until proper tools are ready.

1. create disk image with QCOW2 format

qemu-img create -f qcow2 -o preallocation=metadata /extra/libvirt/images/centos-6-cloud.qcow2 2G

2. install centos, I recomend only one partition and no swap (in grizzly, you can set swap size in flavor)

virt-install --name=centos-6-cloud --disk path=/extra/libvirt/images/centos-6-cloud.qcow2,format=qcow2 -r 1024 --vcpus=1 --hvm -c /extra/iso/CentOS-6.3-x86_64-minimal.iso

3. login into your new image and modify '/etc/sysconfig/network-scripts/ifcfg-eth0' to look like this

DEVICE="eth0"
BOOTPROTO="dhcp"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE="Ethernet"

4. add EPEL repository and update OS

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm

5. install cloud-utils and cloud-init

yum update
yum install cloud-utils, cloud-init

6. Download 'centos-image-mod.sh' and 'init-part' together in same directory, run 'centos-image-mod.sh'. This will modify initrd and grub.conf.

6.1. Edit '/boot/grub/grub.conf', check if everything is OK. Also, may not be a bad idea to set timeout to 0.

7. Delete '/etc/udev/rules.d/70-persistent-net.rules', this will be auto created during boot. Don't forget this, since you won't have functional network when you bring this image up on Openstack.

8. Power down your virtual Centos

9. Compress QCOW2 image with

qemu-img convert -c /extra/libvirt/images/centos-6-cloud.qcow2 -O qcow2 /tmp/centos.qcow2


Image /tmp/centos.qcow2 is now ready for upload to Openstack

- Robert


On 16 May 2013 21:08, Robert Plestenjak <robert.plestenjak [at] xlab> wrote:
> This script will modify initrd for image resize during boot, redirect boot log messages to ttyS0 and set NOOP sceduler. Tested on CentOS 6.3 and 6.4.
>
> https://github.com/flegmatik/centos-image-resize

This would be lovely to integrate into diskimage-builder [as part of a
CentOS supporting element].

-Rob

--
Robert Collins <rbtcollins [at] hp>
Distinguished Technologist
HP Cloud Services

_______________________________________________
OpenStack-operators mailing list
OpenStack-operators [at] lists
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators


robert.plestenjak at xlab

Jun 11, 2013, 5:38 AM

Post #14 of 27 (465 views)
Permalink
Re: CentOS image [In reply to]

Almost forgot, don't forget to install 'wget' and 'openssh-clients'

- Robert

----- Original Message -----
From: "Robert Plestenjak" <robert.plestenjak [at] xlab>
To: openstack-operators [at] lists
Sent: Tuesday, June 11, 2013 11:35:01 AM
Subject: Re: [Openstack-operators] CentOS image

Yes, that would be great.

You can also create image manually in KVM, until proper tools are ready.

1. create disk image with QCOW2 format

qemu-img create -f qcow2 -o preallocation=metadata /extra/libvirt/images/centos-6-cloud.qcow2 2G

2. install centos, I recomend only one partition and no swap (in grizzly, you can set swap size in flavor)

virt-install --name=centos-6-cloud --disk path=/extra/libvirt/images/centos-6-cloud.qcow2,format=qcow2 -r 1024 --vcpus=1 --hvm -c /extra/iso/CentOS-6.3-x86_64-minimal.iso

3. login into your new image and modify '/etc/sysconfig/network-scripts/ifcfg-eth0' to look like this

DEVICE="eth0"
BOOTPROTO="dhcp"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE="Ethernet"

4. add EPEL repository and update OS

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm

5. install cloud-utils and cloud-init

yum update
yum install cloud-utils, cloud-init

6. Download 'centos-image-mod.sh' and 'init-part' together in same directory, run 'centos-image-mod.sh'. This will modify initrd and grub.conf.

6.1. Edit '/boot/grub/grub.conf', check if everything is OK. Also, may not be a bad idea to set timeout to 0.

7. Delete '/etc/udev/rules.d/70-persistent-net.rules', this will be auto created during boot. Don't forget this, since you won't have functional network when you bring this image up on Openstack.

8. Power down your virtual Centos

9. Compress QCOW2 image with

qemu-img convert -c /extra/libvirt/images/centos-6-cloud.qcow2 -O qcow2 /tmp/centos.qcow2


Image /tmp/centos.qcow2 is now ready for upload to Openstack

- Robert


On 16 May 2013 21:08, Robert Plestenjak <robert.plestenjak [at] xlab> wrote:
> This script will modify initrd for image resize during boot, redirect boot log messages to ttyS0 and set NOOP sceduler. Tested on CentOS 6.3 and 6.4.
>
> https://github.com/flegmatik/centos-image-resize

This would be lovely to integrate into diskimage-builder [as part of a
CentOS supporting element].

-Rob

--
Robert Collins <rbtcollins [at] hp>
Distinguished Technologist
HP Cloud Services

_______________________________________________
OpenStack-operators mailing list
OpenStack-operators [at] lists
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators

_______________________________________________
OpenStack-operators mailing list
OpenStack-operators [at] lists
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators


lorin at nimbisservices

Jun 30, 2013, 11:46 AM

Post #15 of 27 (326 views)
Permalink
Re: CentOS image [In reply to]

Robert:

This script doesn't support LVM partitions, does it?

Also, I've discovered that it breaks if there's a /boot partition.
Apparently, if a boot partition is present then grub prepends a "/boot" to
the paths for the kernel and ramdisk, and this script also prepends /boot.

Lorin


On Tue, Jun 11, 2013 at 8:38 AM, Robert Plestenjak <
robert.plestenjak [at] xlab> wrote:

> Almost forgot, don't forget to install 'wget' and 'openssh-clients'
>
> - Robert
>
> ----- Original Message -----
> From: "Robert Plestenjak" <robert.plestenjak [at] xlab>
> To: openstack-operators [at] lists
> Sent: Tuesday, June 11, 2013 11:35:01 AM
> Subject: Re: [Openstack-operators] CentOS image
>
> Yes, that would be great.
>
> You can also create image manually in KVM, until proper tools are ready.
>
> 1. create disk image with QCOW2 format
>
> qemu-img create -f qcow2 -o preallocation=metadata
> /extra/libvirt/images/centos-6-cloud.qcow2 2G
>
> 2. install centos, I recomend only one partition and no swap (in grizzly,
> you can set swap size in flavor)
>
> virt-install --name=centos-6-cloud --disk
> path=/extra/libvirt/images/centos-6-cloud.qcow2,format=qcow2 -r 1024
> --vcpus=1 --hvm -c /extra/iso/CentOS-6.3-x86_64-minimal.iso
>
> 3. login into your new image and modify
> '/etc/sysconfig/network-scripts/ifcfg-eth0' to look like this
>
> DEVICE="eth0"
> BOOTPROTO="dhcp"
> NM_CONTROLLED="no"
> ONBOOT="yes"
> TYPE="Ethernet"
>
> 4. add EPEL repository and update OS
>
> wget
> http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
> rpm -ivh epel-release-6-8.noarch.rpm
>
> 5. install cloud-utils and cloud-init
>
> yum update
> yum install cloud-utils, cloud-init
>
> 6. Download 'centos-image-mod.sh' and 'init-part' together in same
> directory, run 'centos-image-mod.sh'. This will modify initrd and grub.conf.
>
> 6.1. Edit '/boot/grub/grub.conf', check if everything is OK. Also, may not
> be a bad idea to set timeout to 0.
>
> 7. Delete '/etc/udev/rules.d/70-persistent-net.rules', this will be auto
> created during boot. Don't forget this, since you won't have functional
> network when you bring this image up on Openstack.
>
> 8. Power down your virtual Centos
>
> 9. Compress QCOW2 image with
>
> qemu-img convert -c /extra/libvirt/images/centos-6-cloud.qcow2 -O qcow2
> /tmp/centos.qcow2
>
>
> Image /tmp/centos.qcow2 is now ready for upload to Openstack
>
> - Robert
>
>
> On 16 May 2013 21:08, Robert Plestenjak <robert.plestenjak [at] xlab> wrote:
> > This script will modify initrd for image resize during boot, redirect
> boot log messages to ttyS0 and set NOOP sceduler. Tested on CentOS 6.3 and
> 6.4.
> >
> > https://github.com/flegmatik/centos-image-resize
>
> This would be lovely to integrate into diskimage-builder [as part of a
> CentOS supporting element].
>
> -Rob
>
> --
> Robert Collins <rbtcollins [at] hp>
> Distinguished Technologist
> HP Cloud Services
>
> _______________________________________________
> OpenStack-operators mailing list
> OpenStack-operators [at] lists
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>
> _______________________________________________
> OpenStack-operators mailing list
> OpenStack-operators [at] lists
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>



--
Lorin Hochstein
Lead Architect - Cloud Services
Nimbis Services, Inc.
www.nimbisservices.com


joe.topjian at cybera

Jul 2, 2013, 11:13 AM

Post #16 of 27 (320 views)
Permalink
Re: CentOS image [In reply to]

Hi Lorin,

I was working on this the week before last and ran into the same problems
you've described. I was on vacation last week, but before I left, I had a
solution that I'm 99% happy with -- I just need to do some final testing.

Dean Troyer has some great CentOS build scripts
here<https://github.com/dtroyer/image-recipes>.
These scripts will build a CentOS image on the fly from start to finish.
The only issue I ran into was with udev: On first boot, udev will record
the MAC addresses of the virtual NIC(s) in the instance. If you create a
snapshot, these records are not removed and so udev renames the interfaces
to something else.

Here is my fork <https://github.com/jtopjian/image-recipes> of the scripts
which resolves this udev issue.

If you use these scripts, let me know if you run into any issues. I hope to
finish up my testing either this week or next week and finally have a good
(on par with Ubuntu) CentOS cloud image -- even better that it can be
generated on the fly and receive all current updates.

Joe


On Sun, Jun 30, 2013 at 12:46 PM, Lorin Hochstein
<lorin [at] nimbisservices>wrote:

> Robert:
>
> This script doesn't support LVM partitions, does it?
>
> Also, I've discovered that it breaks if there's a /boot partition.
> Apparently, if a boot partition is present then grub prepends a "/boot" to
> the paths for the kernel and ramdisk, and this script also prepends /boot.
>
> Lorin
>
>
> On Tue, Jun 11, 2013 at 8:38 AM, Robert Plestenjak <
> robert.plestenjak [at] xlab> wrote:
>
>> Almost forgot, don't forget to install 'wget' and 'openssh-clients'
>>
>> - Robert
>>
>> ----- Original Message -----
>> From: "Robert Plestenjak" <robert.plestenjak [at] xlab>
>> To: openstack-operators [at] lists
>> Sent: Tuesday, June 11, 2013 11:35:01 AM
>> Subject: Re: [Openstack-operators] CentOS image
>>
>> Yes, that would be great.
>>
>> You can also create image manually in KVM, until proper tools are ready.
>>
>> 1. create disk image with QCOW2 format
>>
>> qemu-img create -f qcow2 -o preallocation=metadata
>> /extra/libvirt/images/centos-6-cloud.qcow2 2G
>>
>> 2. install centos, I recomend only one partition and no swap (in grizzly,
>> you can set swap size in flavor)
>>
>> virt-install --name=centos-6-cloud --disk
>> path=/extra/libvirt/images/centos-6-cloud.qcow2,format=qcow2 -r 1024
>> --vcpus=1 --hvm -c /extra/iso/CentOS-6.3-x86_64-minimal.iso
>>
>> 3. login into your new image and modify
>> '/etc/sysconfig/network-scripts/ifcfg-eth0' to look like this
>>
>> DEVICE="eth0"
>> BOOTPROTO="dhcp"
>> NM_CONTROLLED="no"
>> ONBOOT="yes"
>> TYPE="Ethernet"
>>
>> 4. add EPEL repository and update OS
>>
>> wget
>> http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
>> rpm -ivh epel-release-6-8.noarch.rpm
>>
>> 5. install cloud-utils and cloud-init
>>
>> yum update
>> yum install cloud-utils, cloud-init
>>
>> 6. Download 'centos-image-mod.sh' and 'init-part' together in same
>> directory, run 'centos-image-mod.sh'. This will modify initrd and grub.conf.
>>
>> 6.1. Edit '/boot/grub/grub.conf', check if everything is OK. Also, may
>> not be a bad idea to set timeout to 0.
>>
>> 7. Delete '/etc/udev/rules.d/70-persistent-net.rules', this will be auto
>> created during boot. Don't forget this, since you won't have functional
>> network when you bring this image up on Openstack.
>>
>> 8. Power down your virtual Centos
>>
>> 9. Compress QCOW2 image with
>>
>> qemu-img convert -c /extra/libvirt/images/centos-6-cloud.qcow2 -O qcow2
>> /tmp/centos.qcow2
>>
>>
>> Image /tmp/centos.qcow2 is now ready for upload to Openstack
>>
>> - Robert
>>
>>
>> On 16 May 2013 21:08, Robert Plestenjak <robert.plestenjak [at] xlab>
>> wrote:
>> > This script will modify initrd for image resize during boot, redirect
>> boot log messages to ttyS0 and set NOOP sceduler. Tested on CentOS 6.3 and
>> 6.4.
>> >
>> > https://github.com/flegmatik/centos-image-resize
>>
>> This would be lovely to integrate into diskimage-builder [as part of a
>> CentOS supporting element].
>>
>> -Rob
>>
>> --
>> Robert Collins <rbtcollins [at] hp>
>> Distinguished Technologist
>> HP Cloud Services
>>
>> _______________________________________________
>> OpenStack-operators mailing list
>> OpenStack-operators [at] lists
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>>
>> _______________________________________________
>> OpenStack-operators mailing list
>> OpenStack-operators [at] lists
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>>
>
>
>
> --
> Lorin Hochstein
> Lead Architect - Cloud Services
> Nimbis Services, Inc.
> www.nimbisservices.com
>
> _______________________________________________
> OpenStack-operators mailing list
> OpenStack-operators [at] lists
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>
>


--
Joe Topjian
Systems Architect
Cybera Inc.

www.cybera.ca

Cybera is a not-for-profit organization that works to spur and support
innovation, for the economic benefit of Alberta, through the use
of cyberinfrastructure.


lorin at nimbisservices

Jul 2, 2013, 11:31 AM

Post #17 of 27 (309 views)
Permalink
Re: CentOS image [In reply to]

Joe:

That's great news, I'd like to update the image guide with info on how to
do a fully scripted creation of CentOS images that resize properly.

For udev, there's a great tool called "virt-sysprep" from libguestfs
project. It will remove the MAC address from udev as well as clean up
various other things: http://libguestfs.org/virt-sysprep.1.html

Lorin


On Tue, Jul 2, 2013 at 2:13 PM, Joe Topjian <joe.topjian [at] cybera> wrote:

> Hi Lorin,
>
> I was working on this the week before last and ran into the same problems
> you've described. I was on vacation last week, but before I left, I had a
> solution that I'm 99% happy with -- I just need to do some final testing.
>
> Dean Troyer has some great CentOS build scripts here<https://github.com/dtroyer/image-recipes>.
> These scripts will build a CentOS image on the fly from start to finish.
> The only issue I ran into was with udev: On first boot, udev will record
> the MAC addresses of the virtual NIC(s) in the instance. If you create a
> snapshot, these records are not removed and so udev renames the interfaces
> to something else.
>
> Here is my fork <https://github.com/jtopjian/image-recipes> of the
> scripts which resolves this udev issue.
>
> If you use these scripts, let me know if you run into any issues. I hope
> to finish up my testing either this week or next week and finally have a
> good (on par with Ubuntu) CentOS cloud image -- even better that it can be
> generated on the fly and receive all current updates.
>
> Joe
>
>
> On Sun, Jun 30, 2013 at 12:46 PM, Lorin Hochstein <
> lorin [at] nimbisservices> wrote:
>
>> Robert:
>>
>> This script doesn't support LVM partitions, does it?
>>
>> Also, I've discovered that it breaks if there's a /boot partition.
>> Apparently, if a boot partition is present then grub prepends a "/boot" to
>> the paths for the kernel and ramdisk, and this script also prepends /boot.
>>
>> Lorin
>>
>>
>> On Tue, Jun 11, 2013 at 8:38 AM, Robert Plestenjak <
>> robert.plestenjak [at] xlab> wrote:
>>
>>> Almost forgot, don't forget to install 'wget' and 'openssh-clients'
>>>
>>> - Robert
>>>
>>> ----- Original Message -----
>>> From: "Robert Plestenjak" <robert.plestenjak [at] xlab>
>>> To: openstack-operators [at] lists
>>> Sent: Tuesday, June 11, 2013 11:35:01 AM
>>> Subject: Re: [Openstack-operators] CentOS image
>>>
>>> Yes, that would be great.
>>>
>>> You can also create image manually in KVM, until proper tools are ready.
>>>
>>> 1. create disk image with QCOW2 format
>>>
>>> qemu-img create -f qcow2 -o preallocation=metadata
>>> /extra/libvirt/images/centos-6-cloud.qcow2 2G
>>>
>>> 2. install centos, I recomend only one partition and no swap (in
>>> grizzly, you can set swap size in flavor)
>>>
>>> virt-install --name=centos-6-cloud --disk
>>> path=/extra/libvirt/images/centos-6-cloud.qcow2,format=qcow2 -r 1024
>>> --vcpus=1 --hvm -c /extra/iso/CentOS-6.3-x86_64-minimal.iso
>>>
>>> 3. login into your new image and modify
>>> '/etc/sysconfig/network-scripts/ifcfg-eth0' to look like this
>>>
>>> DEVICE="eth0"
>>> BOOTPROTO="dhcp"
>>> NM_CONTROLLED="no"
>>> ONBOOT="yes"
>>> TYPE="Ethernet"
>>>
>>> 4. add EPEL repository and update OS
>>>
>>> wget
>>> http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
>>> rpm -ivh epel-release-6-8.noarch.rpm
>>>
>>> 5. install cloud-utils and cloud-init
>>>
>>> yum update
>>> yum install cloud-utils, cloud-init
>>>
>>> 6. Download 'centos-image-mod.sh' and 'init-part' together in same
>>> directory, run 'centos-image-mod.sh'. This will modify initrd and grub.conf.
>>>
>>> 6.1. Edit '/boot/grub/grub.conf', check if everything is OK. Also, may
>>> not be a bad idea to set timeout to 0.
>>>
>>> 7. Delete '/etc/udev/rules.d/70-persistent-net.rules', this will be auto
>>> created during boot. Don't forget this, since you won't have functional
>>> network when you bring this image up on Openstack.
>>>
>>> 8. Power down your virtual Centos
>>>
>>> 9. Compress QCOW2 image with
>>>
>>> qemu-img convert -c /extra/libvirt/images/centos-6-cloud.qcow2 -O qcow2
>>> /tmp/centos.qcow2
>>>
>>>
>>> Image /tmp/centos.qcow2 is now ready for upload to Openstack
>>>
>>> - Robert
>>>
>>>
>>> On 16 May 2013 21:08, Robert Plestenjak <robert.plestenjak [at] xlab>
>>> wrote:
>>> > This script will modify initrd for image resize during boot, redirect
>>> boot log messages to ttyS0 and set NOOP sceduler. Tested on CentOS 6.3 and
>>> 6.4.
>>> >
>>> > https://github.com/flegmatik/centos-image-resize
>>>
>>> This would be lovely to integrate into diskimage-builder [as part of a
>>> CentOS supporting element].
>>>
>>> -Rob
>>>
>>> --
>>> Robert Collins <rbtcollins [at] hp>
>>> Distinguished Technologist
>>> HP Cloud Services
>>>
>>> _______________________________________________
>>> OpenStack-operators mailing list
>>> OpenStack-operators [at] lists
>>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>>>
>>> _______________________________________________
>>> OpenStack-operators mailing list
>>> OpenStack-operators [at] lists
>>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>>>
>>
>>
>>
>> --
>> Lorin Hochstein
>> Lead Architect - Cloud Services
>> Nimbis Services, Inc.
>> www.nimbisservices.com
>>
>> _______________________________________________
>> OpenStack-operators mailing list
>> OpenStack-operators [at] lists
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>>
>>
>
>
> --
> Joe Topjian
> Systems Architect
> Cybera Inc.
>
> www.cybera.ca
>
> Cybera is a not-for-profit organization that works to spur and support
> innovation, for the economic benefit of Alberta, through the use
> of cyberinfrastructure.
>



--
Lorin Hochstein
Lead Architect - Cloud Services
Nimbis Services, Inc.
www.nimbisservices.com


joe.topjian at cybera

Jul 2, 2013, 12:06 PM

Post #18 of 27 (313 views)
Permalink
Re: CentOS image [In reply to]

Hi Lorin,

Right, virt-sysprep is used in Dean's build script to create the initial
image. The issue I see is when an instance is created from the image and
then a snapshot is created -- unless the udev rules are manually removed
prior to snapshot creation, they will still exist for each instance based
off of the snapshot and so the virtual NICs won't get named properly.

Maybe virt-sysprep can be run from inside the instance? If so, it still
requires all users to manually run it prior to snapshotting. This is why
I've gone and just disabled udev rule entries for all NICs (based on a
KVM-based MAC address).

Joe


On Tue, Jul 2, 2013 at 12:31 PM, Lorin Hochstein
<lorin [at] nimbisservices>wrote:

> Joe:
>
> That's great news, I'd like to update the image guide with info on how to
> do a fully scripted creation of CentOS images that resize properly.
>
> For udev, there's a great tool called "virt-sysprep" from libguestfs
> project. It will remove the MAC address from udev as well as clean up
> various other things: http://libguestfs.org/virt-sysprep.1.html
>
> Lorin
>
>
> On Tue, Jul 2, 2013 at 2:13 PM, Joe Topjian <joe.topjian [at] cybera> wrote:
>
>> Hi Lorin,
>>
>> I was working on this the week before last and ran into the same problems
>> you've described. I was on vacation last week, but before I left, I had a
>> solution that I'm 99% happy with -- I just need to do some final testing.
>>
>> Dean Troyer has some great CentOS build scripts here<https://github.com/dtroyer/image-recipes>.
>> These scripts will build a CentOS image on the fly from start to finish.
>> The only issue I ran into was with udev: On first boot, udev will record
>> the MAC addresses of the virtual NIC(s) in the instance. If you create a
>> snapshot, these records are not removed and so udev renames the interfaces
>> to something else.
>>
>> Here is my fork <https://github.com/jtopjian/image-recipes> of the
>> scripts which resolves this udev issue.
>>
>> If you use these scripts, let me know if you run into any issues. I hope
>> to finish up my testing either this week or next week and finally have a
>> good (on par with Ubuntu) CentOS cloud image -- even better that it can be
>> generated on the fly and receive all current updates.
>>
>> Joe
>>
>>
>> On Sun, Jun 30, 2013 at 12:46 PM, Lorin Hochstein <
>> lorin [at] nimbisservices> wrote:
>>
>>> Robert:
>>>
>>> This script doesn't support LVM partitions, does it?
>>>
>>> Also, I've discovered that it breaks if there's a /boot partition.
>>> Apparently, if a boot partition is present then grub prepends a "/boot" to
>>> the paths for the kernel and ramdisk, and this script also prepends /boot.
>>>
>>> Lorin
>>>
>>>
>>> On Tue, Jun 11, 2013 at 8:38 AM, Robert Plestenjak <
>>> robert.plestenjak [at] xlab> wrote:
>>>
>>>> Almost forgot, don't forget to install 'wget' and 'openssh-clients'
>>>>
>>>> - Robert
>>>>
>>>> ----- Original Message -----
>>>> From: "Robert Plestenjak" <robert.plestenjak [at] xlab>
>>>> To: openstack-operators [at] lists
>>>> Sent: Tuesday, June 11, 2013 11:35:01 AM
>>>> Subject: Re: [Openstack-operators] CentOS image
>>>>
>>>> Yes, that would be great.
>>>>
>>>> You can also create image manually in KVM, until proper tools are ready.
>>>>
>>>> 1. create disk image with QCOW2 format
>>>>
>>>> qemu-img create -f qcow2 -o preallocation=metadata
>>>> /extra/libvirt/images/centos-6-cloud.qcow2 2G
>>>>
>>>> 2. install centos, I recomend only one partition and no swap (in
>>>> grizzly, you can set swap size in flavor)
>>>>
>>>> virt-install --name=centos-6-cloud --disk
>>>> path=/extra/libvirt/images/centos-6-cloud.qcow2,format=qcow2 -r 1024
>>>> --vcpus=1 --hvm -c /extra/iso/CentOS-6.3-x86_64-minimal.iso
>>>>
>>>> 3. login into your new image and modify
>>>> '/etc/sysconfig/network-scripts/ifcfg-eth0' to look like this
>>>>
>>>> DEVICE="eth0"
>>>> BOOTPROTO="dhcp"
>>>> NM_CONTROLLED="no"
>>>> ONBOOT="yes"
>>>> TYPE="Ethernet"
>>>>
>>>> 4. add EPEL repository and update OS
>>>>
>>>> wget
>>>> http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
>>>> rpm -ivh epel-release-6-8.noarch.rpm
>>>>
>>>> 5. install cloud-utils and cloud-init
>>>>
>>>> yum update
>>>> yum install cloud-utils, cloud-init
>>>>
>>>> 6. Download 'centos-image-mod.sh' and 'init-part' together in same
>>>> directory, run 'centos-image-mod.sh'. This will modify initrd and grub.conf.
>>>>
>>>> 6.1. Edit '/boot/grub/grub.conf', check if everything is OK. Also, may
>>>> not be a bad idea to set timeout to 0.
>>>>
>>>> 7. Delete '/etc/udev/rules.d/70-persistent-net.rules', this will be
>>>> auto created during boot. Don't forget this, since you won't have
>>>> functional network when you bring this image up on Openstack.
>>>>
>>>> 8. Power down your virtual Centos
>>>>
>>>> 9. Compress QCOW2 image with
>>>>
>>>> qemu-img convert -c /extra/libvirt/images/centos-6-cloud.qcow2 -O qcow2
>>>> /tmp/centos.qcow2
>>>>
>>>>
>>>> Image /tmp/centos.qcow2 is now ready for upload to Openstack
>>>>
>>>> - Robert
>>>>
>>>>
>>>> On 16 May 2013 21:08, Robert Plestenjak <robert.plestenjak [at] xlab>
>>>> wrote:
>>>> > This script will modify initrd for image resize during boot, redirect
>>>> boot log messages to ttyS0 and set NOOP sceduler. Tested on CentOS 6.3 and
>>>> 6.4.
>>>> >
>>>> > https://github.com/flegmatik/centos-image-resize
>>>>
>>>> This would be lovely to integrate into diskimage-builder [as part of a
>>>> CentOS supporting element].
>>>>
>>>> -Rob
>>>>
>>>> --
>>>> Robert Collins <rbtcollins [at] hp>
>>>> Distinguished Technologist
>>>> HP Cloud Services
>>>>
>>>> _______________________________________________
>>>> OpenStack-operators mailing list
>>>> OpenStack-operators [at] lists
>>>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>>>>
>>>> _______________________________________________
>>>> OpenStack-operators mailing list
>>>> OpenStack-operators [at] lists
>>>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>>>>
>>>
>>>
>>>
>>> --
>>> Lorin Hochstein
>>> Lead Architect - Cloud Services
>>> Nimbis Services, Inc.
>>> www.nimbisservices.com
>>>
>>> _______________________________________________
>>> OpenStack-operators mailing list
>>> OpenStack-operators [at] lists
>>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>>>
>>>
>>
>>
>> --
>> Joe Topjian
>> Systems Architect
>> Cybera Inc.
>>
>> www.cybera.ca
>>
>> Cybera is a not-for-profit organization that works to spur and support
>> innovation, for the economic benefit of Alberta, through the use
>> of cyberinfrastructure.
>>
>
>
>
> --
> Lorin Hochstein
> Lead Architect - Cloud Services
> Nimbis Services, Inc.
> www.nimbisservices.com
>



--
Joe Topjian
Systems Architect
Cybera Inc.

www.cybera.ca

Cybera is a not-for-profit organization that works to spur and support
innovation, for the economic benefit of Alberta, through the use
of cyberinfrastructure.


lorin at nimbisservices

Jul 2, 2013, 12:15 PM

Post #19 of 27 (301 views)
Permalink
Re: CentOS image [In reply to]

Hi Joe:

Ah, gotcha. No, you couldn't use virt-sysprep from inside of the instance.
It only works on VMs that are shutdown.

It's a shame that virt-sysprep doesn't completely remove the relevant udev
rules generator entirely.

Lorin


On Tue, Jul 2, 2013 at 3:06 PM, Joe Topjian <joe.topjian [at] cybera> wrote:

> Hi Lorin,
>
> Right, virt-sysprep is used in Dean's build script to create the initial
> image. The issue I see is when an instance is created from the image and
> then a snapshot is created -- unless the udev rules are manually removed
> prior to snapshot creation, they will still exist for each instance based
> off of the snapshot and so the virtual NICs won't get named properly.
>
> Maybe virt-sysprep can be run from inside the instance? If so, it still
> requires all users to manually run it prior to snapshotting. This is why
> I've gone and just disabled udev rule entries for all NICs (based on a
> KVM-based MAC address).
>
> Joe
>
>
> On Tue, Jul 2, 2013 at 12:31 PM, Lorin Hochstein <lorin [at] nimbisservices
> > wrote:
>
>> Joe:
>>
>> That's great news, I'd like to update the image guide with info on how to
>> do a fully scripted creation of CentOS images that resize properly.
>>
>> For udev, there's a great tool called "virt-sysprep" from libguestfs
>> project. It will remove the MAC address from udev as well as clean up
>> various other things: http://libguestfs.org/virt-sysprep.1.html
>>
>> Lorin
>>
>>
>> On Tue, Jul 2, 2013 at 2:13 PM, Joe Topjian <joe.topjian [at] cybera>wrote:
>>
>>> Hi Lorin,
>>>
>>> I was working on this the week before last and ran into the same
>>> problems you've described. I was on vacation last week, but before I left,
>>> I had a solution that I'm 99% happy with -- I just need to do some final
>>> testing.
>>>
>>> Dean Troyer has some great CentOS build scripts here<https://github.com/dtroyer/image-recipes>.
>>> These scripts will build a CentOS image on the fly from start to finish.
>>> The only issue I ran into was with udev: On first boot, udev will record
>>> the MAC addresses of the virtual NIC(s) in the instance. If you create a
>>> snapshot, these records are not removed and so udev renames the interfaces
>>> to something else.
>>>
>>> Here is my fork <https://github.com/jtopjian/image-recipes> of the
>>> scripts which resolves this udev issue.
>>>
>>> If you use these scripts, let me know if you run into any issues. I hope
>>> to finish up my testing either this week or next week and finally have a
>>> good (on par with Ubuntu) CentOS cloud image -- even better that it can be
>>> generated on the fly and receive all current updates.
>>>
>>> Joe
>>>
>>>
>>> On Sun, Jun 30, 2013 at 12:46 PM, Lorin Hochstein <
>>> lorin [at] nimbisservices> wrote:
>>>
>>>> Robert:
>>>>
>>>> This script doesn't support LVM partitions, does it?
>>>>
>>>> Also, I've discovered that it breaks if there's a /boot partition.
>>>> Apparently, if a boot partition is present then grub prepends a "/boot" to
>>>> the paths for the kernel and ramdisk, and this script also prepends /boot.
>>>>
>>>> Lorin
>>>>
>>>>
>>>> On Tue, Jun 11, 2013 at 8:38 AM, Robert Plestenjak <
>>>> robert.plestenjak [at] xlab> wrote:
>>>>
>>>>> Almost forgot, don't forget to install 'wget' and 'openssh-clients'
>>>>>
>>>>> - Robert
>>>>>
>>>>> ----- Original Message -----
>>>>> From: "Robert Plestenjak" <robert.plestenjak [at] xlab>
>>>>> To: openstack-operators [at] lists
>>>>> Sent: Tuesday, June 11, 2013 11:35:01 AM
>>>>> Subject: Re: [Openstack-operators] CentOS image
>>>>>
>>>>> Yes, that would be great.
>>>>>
>>>>> You can also create image manually in KVM, until proper tools are
>>>>> ready.
>>>>>
>>>>> 1. create disk image with QCOW2 format
>>>>>
>>>>> qemu-img create -f qcow2 -o preallocation=metadata
>>>>> /extra/libvirt/images/centos-6-cloud.qcow2 2G
>>>>>
>>>>> 2. install centos, I recomend only one partition and no swap (in
>>>>> grizzly, you can set swap size in flavor)
>>>>>
>>>>> virt-install --name=centos-6-cloud --disk
>>>>> path=/extra/libvirt/images/centos-6-cloud.qcow2,format=qcow2 -r 1024
>>>>> --vcpus=1 --hvm -c /extra/iso/CentOS-6.3-x86_64-minimal.iso
>>>>>
>>>>> 3. login into your new image and modify
>>>>> '/etc/sysconfig/network-scripts/ifcfg-eth0' to look like this
>>>>>
>>>>> DEVICE="eth0"
>>>>> BOOTPROTO="dhcp"
>>>>> NM_CONTROLLED="no"
>>>>> ONBOOT="yes"
>>>>> TYPE="Ethernet"
>>>>>
>>>>> 4. add EPEL repository and update OS
>>>>>
>>>>> wget
>>>>> http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
>>>>> rpm -ivh epel-release-6-8.noarch.rpm
>>>>>
>>>>> 5. install cloud-utils and cloud-init
>>>>>
>>>>> yum update
>>>>> yum install cloud-utils, cloud-init
>>>>>
>>>>> 6. Download 'centos-image-mod.sh' and 'init-part' together in same
>>>>> directory, run 'centos-image-mod.sh'. This will modify initrd and grub.conf.
>>>>>
>>>>> 6.1. Edit '/boot/grub/grub.conf', check if everything is OK. Also, may
>>>>> not be a bad idea to set timeout to 0.
>>>>>
>>>>> 7. Delete '/etc/udev/rules.d/70-persistent-net.rules', this will be
>>>>> auto created during boot. Don't forget this, since you won't have
>>>>> functional network when you bring this image up on Openstack.
>>>>>
>>>>> 8. Power down your virtual Centos
>>>>>
>>>>> 9. Compress QCOW2 image with
>>>>>
>>>>> qemu-img convert -c /extra/libvirt/images/centos-6-cloud.qcow2 -O
>>>>> qcow2 /tmp/centos.qcow2
>>>>>
>>>>>
>>>>> Image /tmp/centos.qcow2 is now ready for upload to Openstack
>>>>>
>>>>> - Robert
>>>>>
>>>>>
>>>>> On 16 May 2013 21:08, Robert Plestenjak <robert.plestenjak [at] xlab>
>>>>> wrote:
>>>>> > This script will modify initrd for image resize during boot,
>>>>> redirect boot log messages to ttyS0 and set NOOP sceduler. Tested on CentOS
>>>>> 6.3 and 6.4.
>>>>> >
>>>>> > https://github.com/flegmatik/centos-image-resize
>>>>>
>>>>> This would be lovely to integrate into diskimage-builder [as part of a
>>>>> CentOS supporting element].
>>>>>
>>>>> -Rob
>>>>>
>>>>> --
>>>>> Robert Collins <rbtcollins [at] hp>
>>>>> Distinguished Technologist
>>>>> HP Cloud Services
>>>>>
>>>>> _______________________________________________
>>>>> OpenStack-operators mailing list
>>>>> OpenStack-operators [at] lists
>>>>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>>>>>
>>>>> _______________________________________________
>>>>> OpenStack-operators mailing list
>>>>> OpenStack-operators [at] lists
>>>>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Lorin Hochstein
>>>> Lead Architect - Cloud Services
>>>> Nimbis Services, Inc.
>>>> www.nimbisservices.com
>>>>
>>>> _______________________________________________
>>>> OpenStack-operators mailing list
>>>> OpenStack-operators [at] lists
>>>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>>>>
>>>>
>>>
>>>
>>> --
>>> Joe Topjian
>>> Systems Architect
>>> Cybera Inc.
>>>
>>> www.cybera.ca
>>>
>>> Cybera is a not-for-profit organization that works to spur and support
>>> innovation, for the economic benefit of Alberta, through the use
>>> of cyberinfrastructure.
>>>
>>
>>
>>
>> --
>> Lorin Hochstein
>> Lead Architect - Cloud Services
>> Nimbis Services, Inc.
>> www.nimbisservices.com
>>
>
>
>
> --
> Joe Topjian
> Systems Architect
> Cybera Inc.
>
> www.cybera.ca
>
> Cybera is a not-for-profit organization that works to spur and support
> innovation, for the economic benefit of Alberta, through the use
> of cyberinfrastructure.
>



--
Lorin Hochstein
Lead Architect - Cloud Services
Nimbis Services, Inc.
www.nimbisservices.com


brian.schott at nimbisservices

Jul 2, 2013, 12:53 PM

Post #20 of 27 (312 views)
Permalink
Re: CentOS image [In reply to]

Are you guys following Disk Image Builder project?
https://github.com/stackforge/diskimage-builder
I saw a bug related to udev rules for Fedora.

-------------------------------------------------
Brian Schott, CTO
Nimbis Services, Inc.
brian.schott [at] nimbisservices
ph: 443-274-6064 fx: 443-274-6060



On Jul 2, 2013, at 3:15 PM, Lorin Hochstein <lorin [at] nimbisservices> wrote:

> Hi Joe:
>
> Ah, gotcha. No, you couldn't use virt-sysprep from inside of the instance. It only works on VMs that are shutdown.
>
> It's a shame that virt-sysprep doesn't completely remove the relevant udev rules generator entirely.
>
> Lorin
>
>
> On Tue, Jul 2, 2013 at 3:06 PM, Joe Topjian <joe.topjian [at] cybera> wrote:
> Hi Lorin,
>
> Right, virt-sysprep is used in Dean's build script to create the initial image. The issue I see is when an instance is created from the image and then a snapshot is created -- unless the udev rules are manually removed prior to snapshot creation, they will still exist for each instance based off of the snapshot and so the virtual NICs won't get named properly.
>
> Maybe virt-sysprep can be run from inside the instance? If so, it still requires all users to manually run it prior to snapshotting. This is why I've gone and just disabled udev rule entries for all NICs (based on a KVM-based MAC address).
>
> Joe
>
>
> On Tue, Jul 2, 2013 at 12:31 PM, Lorin Hochstein <lorin [at] nimbisservices> wrote:
> Joe:
>
> That's great news, I'd like to update the image guide with info on how to do a fully scripted creation of CentOS images that resize properly.
>
> For udev, there's a great tool called "virt-sysprep" from libguestfs project. It will remove the MAC address from udev as well as clean up various other things: http://libguestfs.org/virt-sysprep.1.html
>
> Lorin
>
>
> On Tue, Jul 2, 2013 at 2:13 PM, Joe Topjian <joe.topjian [at] cybera> wrote:
> Hi Lorin,
>
> I was working on this the week before last and ran into the same problems you've described. I was on vacation last week, but before I left, I had a solution that I'm 99% happy with -- I just need to do some final testing.
>
> Dean Troyer has some great CentOS build scripts here. These scripts will build a CentOS image on the fly from start to finish. The only issue I ran into was with udev: On first boot, udev will record the MAC addresses of the virtual NIC(s) in the instance. If you create a snapshot, these records are not removed and so udev renames the interfaces to something else.
>
> Here is my fork of the scripts which resolves this udev issue.
>
> If you use these scripts, let me know if you run into any issues. I hope to finish up my testing either this week or next week and finally have a good (on par with Ubuntu) CentOS cloud image -- even better that it can be generated on the fly and receive all current updates.
>
> Joe
>
>
> On Sun, Jun 30, 2013 at 12:46 PM, Lorin Hochstein <lorin [at] nimbisservices> wrote:
> Robert:
>
> This script doesn't support LVM partitions, does it?
>
> Also, I've discovered that it breaks if there's a /boot partition. Apparently, if a boot partition is present then grub prepends a "/boot" to the paths for the kernel and ramdisk, and this script also prepends /boot.
>
> Lorin
>
>
> On Tue, Jun 11, 2013 at 8:38 AM, Robert Plestenjak <robert.plestenjak [at] xlab> wrote:
> Almost forgot, don't forget to install 'wget' and 'openssh-clients'
>
> - Robert
>
> ----- Original Message -----
> From: "Robert Plestenjak" <robert.plestenjak [at] xlab>
> To: openstack-operators [at] lists
> Sent: Tuesday, June 11, 2013 11:35:01 AM
> Subject: Re: [Openstack-operators] CentOS image
>
> Yes, that would be great.
>
> You can also create image manually in KVM, until proper tools are ready.
>
> 1. create disk image with QCOW2 format
>
> qemu-img create -f qcow2 -o preallocation=metadata /extra/libvirt/images/centos-6-cloud.qcow2 2G
>
> 2. install centos, I recomend only one partition and no swap (in grizzly, you can set swap size in flavor)
>
> virt-install --name=centos-6-cloud --disk path=/extra/libvirt/images/centos-6-cloud.qcow2,format=qcow2 -r 1024 --vcpus=1 --hvm -c /extra/iso/CentOS-6.3-x86_64-minimal.iso
>
> 3. login into your new image and modify '/etc/sysconfig/network-scripts/ifcfg-eth0' to look like this
>
> DEVICE="eth0"
> BOOTPROTO="dhcp"
> NM_CONTROLLED="no"
> ONBOOT="yes"
> TYPE="Ethernet"
>
> 4. add EPEL repository and update OS
>
> wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
> rpm -ivh epel-release-6-8.noarch.rpm
>
> 5. install cloud-utils and cloud-init
>
> yum update
> yum install cloud-utils, cloud-init
>
> 6. Download 'centos-image-mod.sh' and 'init-part' together in same directory, run 'centos-image-mod.sh'. This will modify initrd and grub.conf.
>
> 6.1. Edit '/boot/grub/grub.conf', check if everything is OK. Also, may not be a bad idea to set timeout to 0.
>
> 7. Delete '/etc/udev/rules.d/70-persistent-net.rules', this will be auto created during boot. Don't forget this, since you won't have functional network when you bring this image up on Openstack.
>
> 8. Power down your virtual Centos
>
> 9. Compress QCOW2 image with
>
> qemu-img convert -c /extra/libvirt/images/centos-6-cloud.qcow2 -O qcow2 /tmp/centos.qcow2
>
>
> Image /tmp/centos.qcow2 is now ready for upload to Openstack
>
> - Robert
>
>
> On 16 May 2013 21:08, Robert Plestenjak <robert.plestenjak [at] xlab> wrote:
> > This script will modify initrd for image resize during boot, redirect boot log messages to ttyS0 and set NOOP sceduler. Tested on CentOS 6.3 and 6.4.
> >
> > https://github.com/flegmatik/centos-image-resize
>
> This would be lovely to integrate into diskimage-builder [as part of a
> CentOS supporting element].
>
> -Rob
>
> --
> Robert Collins <rbtcollins [at] hp>
> Distinguished Technologist
> HP Cloud Services
>
> _______________________________________________
> OpenStack-operators mailing list
> OpenStack-operators [at] lists
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>
> _______________________________________________
> OpenStack-operators mailing list
> OpenStack-operators [at] lists
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>
>
>
> --
> Lorin Hochstein
> Lead Architect - Cloud Services
> Nimbis Services, Inc.
> www.nimbisservices.com
>
> _______________________________________________
> OpenStack-operators mailing list
> OpenStack-operators [at] lists
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>
>
>
>
> --
> Joe Topjian
> Systems Architect
> Cybera Inc.
>
> www.cybera.ca
>
> Cybera is a not-for-profit organization that works to spur and support innovation, for the economic benefit of Alberta, through the use of cyberinfrastructure.
>
>
>
> --
> Lorin Hochstein
> Lead Architect - Cloud Services
> Nimbis Services, Inc.
> www.nimbisservices.com
>
>
>
> --
> Joe Topjian
> Systems Architect
> Cybera Inc.
>
> www.cybera.ca
>
> Cybera is a not-for-profit organization that works to spur and support innovation, for the economic benefit of Alberta, through the use of cyberinfrastructure.
>
>
>
> --
> Lorin Hochstein
> Lead Architect - Cloud Services
> Nimbis Services, Inc.
> www.nimbisservices.com
> _______________________________________________
> OpenStack-operators mailing list
> OpenStack-operators [at] lists
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators


lorin at nimbisservices

Jul 3, 2013, 10:15 AM

Post #21 of 27 (305 views)
Permalink
Re: CentOS image [In reply to]

Yeah, I'm vaguely aware of it, but it's a little lacking in documentation
about how to use any of the pieces. I should probably take a closer look.


On Tue, Jul 2, 2013 at 3:53 PM, Brian Schott <
brian.schott [at] nimbisservices> wrote:

> Are you guys following Disk Image Builder project?
> https://github.com/stackforge/diskimage-builder
> I saw a bug related to udev rules for Fedora.
>
> -------------------------------------------------
> Brian Schott, CTO
> Nimbis Services, Inc.
> brian.schott [at] nimbisservices
> ph: 443-274-6064 fx: 443-274-6060
>
>
>
> On Jul 2, 2013, at 3:15 PM, Lorin Hochstein <lorin [at] nimbisservices>
> wrote:
>
> Hi Joe:
>
> Ah, gotcha. No, you couldn't use virt-sysprep from inside of the instance.
> It only works on VMs that are shutdown.
>
> It's a shame that virt-sysprep doesn't completely remove the relevant udev
> rules generator entirely.
>
> Lorin
>
>
> On Tue, Jul 2, 2013 at 3:06 PM, Joe Topjian <joe.topjian [at] cybera> wrote:
>
>> Hi Lorin,
>>
>> Right, virt-sysprep is used in Dean's build script to create the initial
>> image. The issue I see is when an instance is created from the image and
>> then a snapshot is created -- unless the udev rules are manually removed
>> prior to snapshot creation, they will still exist for each instance based
>> off of the snapshot and so the virtual NICs won't get named properly.
>>
>> Maybe virt-sysprep can be run from inside the instance? If so, it still
>> requires all users to manually run it prior to snapshotting. This is why
>> I've gone and just disabled udev rule entries for all NICs (based on a
>> KVM-based MAC address).
>>
>> Joe
>>
>>
>> On Tue, Jul 2, 2013 at 12:31 PM, Lorin Hochstein <
>> lorin [at] nimbisservices> wrote:
>>
>>> Joe:
>>>
>>> That's great news, I'd like to update the image guide with info on how
>>> to do a fully scripted creation of CentOS images that resize properly.
>>>
>>> For udev, there's a great tool called "virt-sysprep" from libguestfs
>>> project. It will remove the MAC address from udev as well as clean up
>>> various other things: http://libguestfs.org/virt-sysprep.1.html
>>>
>>> Lorin
>>>
>>>
>>> On Tue, Jul 2, 2013 at 2:13 PM, Joe Topjian <joe.topjian [at] cybera>wrote:
>>>
>>>> Hi Lorin,
>>>>
>>>> I was working on this the week before last and ran into the same
>>>> problems you've described. I was on vacation last week, but before I left,
>>>> I had a solution that I'm 99% happy with -- I just need to do some final
>>>> testing.
>>>>
>>>> Dean Troyer has some great CentOS build scripts here<https://github.com/dtroyer/image-recipes>.
>>>> These scripts will build a CentOS image on the fly from start to finish.
>>>> The only issue I ran into was with udev: On first boot, udev will record
>>>> the MAC addresses of the virtual NIC(s) in the instance. If you create a
>>>> snapshot, these records are not removed and so udev renames the interfaces
>>>> to something else.
>>>>
>>>> Here is my fork <https://github.com/jtopjian/image-recipes> of the
>>>> scripts which resolves this udev issue.
>>>>
>>>> If you use these scripts, let me know if you run into any issues. I
>>>> hope to finish up my testing either this week or next week and finally have
>>>> a good (on par with Ubuntu) CentOS cloud image -- even better that it can
>>>> be generated on the fly and receive all current updates.
>>>>
>>>> Joe
>>>>
>>>>
>>>> On Sun, Jun 30, 2013 at 12:46 PM, Lorin Hochstein <
>>>> lorin [at] nimbisservices> wrote:
>>>>
>>>>> Robert:
>>>>>
>>>>> This script doesn't support LVM partitions, does it?
>>>>>
>>>>> Also, I've discovered that it breaks if there's a /boot partition.
>>>>> Apparently, if a boot partition is present then grub prepends a "/boot" to
>>>>> the paths for the kernel and ramdisk, and this script also prepends /boot.
>>>>>
>>>>> Lorin
>>>>>
>>>>>
>>>>> On Tue, Jun 11, 2013 at 8:38 AM, Robert Plestenjak <
>>>>> robert.plestenjak [at] xlab> wrote:
>>>>>
>>>>>> Almost forgot, don't forget to install 'wget' and 'openssh-clients'
>>>>>>
>>>>>> - Robert
>>>>>>
>>>>>> ----- Original Message -----
>>>>>> From: "Robert Plestenjak" <robert.plestenjak [at] xlab>
>>>>>> To: openstack-operators [at] lists
>>>>>> Sent: Tuesday, June 11, 2013 11:35:01 AM
>>>>>> Subject: Re: [Openstack-operators] CentOS image
>>>>>>
>>>>>> Yes, that would be great.
>>>>>>
>>>>>> You can also create image manually in KVM, until proper tools are
>>>>>> ready.
>>>>>>
>>>>>> 1. create disk image with QCOW2 format
>>>>>>
>>>>>> qemu-img create -f qcow2 -o preallocation=metadata
>>>>>> /extra/libvirt/images/centos-6-cloud.qcow2 2G
>>>>>>
>>>>>> 2. install centos, I recomend only one partition and no swap (in
>>>>>> grizzly, you can set swap size in flavor)
>>>>>>
>>>>>> virt-install --name=centos-6-cloud --disk
>>>>>> path=/extra/libvirt/images/centos-6-cloud.qcow2,format=qcow2 -r 1024
>>>>>> --vcpus=1 --hvm -c /extra/iso/CentOS-6.3-x86_64-minimal.iso
>>>>>>
>>>>>> 3. login into your new image and modify
>>>>>> '/etc/sysconfig/network-scripts/ifcfg-eth0' to look like this
>>>>>>
>>>>>> DEVICE="eth0"
>>>>>> BOOTPROTO="dhcp"
>>>>>> NM_CONTROLLED="no"
>>>>>> ONBOOT="yes"
>>>>>> TYPE="Ethernet"
>>>>>>
>>>>>> 4. add EPEL repository and update OS
>>>>>>
>>>>>> wget
>>>>>> http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
>>>>>> rpm -ivh epel-release-6-8.noarch.rpm
>>>>>>
>>>>>> 5. install cloud-utils and cloud-init
>>>>>>
>>>>>> yum update
>>>>>> yum install cloud-utils, cloud-init
>>>>>>
>>>>>> 6. Download 'centos-image-mod.sh' and 'init-part' together in same
>>>>>> directory, run 'centos-image-mod.sh'. This will modify initrd and grub.conf.
>>>>>>
>>>>>> 6.1. Edit '/boot/grub/grub.conf', check if everything is OK. Also,
>>>>>> may not be a bad idea to set timeout to 0.
>>>>>>
>>>>>> 7. Delete '/etc/udev/rules.d/70-persistent-net.rules', this will be
>>>>>> auto created during boot. Don't forget this, since you won't have
>>>>>> functional network when you bring this image up on Openstack.
>>>>>>
>>>>>> 8. Power down your virtual Centos
>>>>>>
>>>>>> 9. Compress QCOW2 image with
>>>>>>
>>>>>> qemu-img convert -c /extra/libvirt/images/centos-6-cloud.qcow2 -O
>>>>>> qcow2 /tmp/centos.qcow2
>>>>>>
>>>>>>
>>>>>> Image /tmp/centos.qcow2 is now ready for upload to Openstack
>>>>>>
>>>>>> - Robert
>>>>>>
>>>>>>
>>>>>> On 16 May 2013 21:08, Robert Plestenjak <robert.plestenjak [at] xlab>
>>>>>> wrote:
>>>>>> > This script will modify initrd for image resize during boot,
>>>>>> redirect boot log messages to ttyS0 and set NOOP sceduler. Tested on CentOS
>>>>>> 6.3 and 6.4.
>>>>>> >
>>>>>> > https://github.com/flegmatik/centos-image-resize
>>>>>>
>>>>>> This would be lovely to integrate into diskimage-builder [as part of a
>>>>>> CentOS supporting element].
>>>>>>
>>>>>> -Rob
>>>>>>
>>>>>> --
>>>>>> Robert Collins <rbtcollins [at] hp>
>>>>>> Distinguished Technologist
>>>>>> HP Cloud Services
>>>>>>
>>>>>> _______________________________________________
>>>>>> OpenStack-operators mailing list
>>>>>> OpenStack-operators [at] lists
>>>>>>
>>>>>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>>>>>>
>>>>>> _______________________________________________
>>>>>> OpenStack-operators mailing list
>>>>>> OpenStack-operators [at] lists
>>>>>>
>>>>>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Lorin Hochstein
>>>>> Lead Architect - Cloud Services
>>>>> Nimbis Services, Inc.
>>>>> www.nimbisservices.com
>>>>>
>>>>> _______________________________________________
>>>>> OpenStack-operators mailing list
>>>>> OpenStack-operators [at] lists
>>>>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Joe Topjian
>>>> Systems Architect
>>>> Cybera Inc.
>>>>
>>>> www.cybera.ca
>>>>
>>>> Cybera is a not-for-profit organization that works to spur and support
>>>> innovation, for the economic benefit of Alberta, through the use
>>>> of cyberinfrastructure.
>>>>
>>>
>>>
>>>
>>> --
>>> Lorin Hochstein
>>> Lead Architect - Cloud Services
>>> Nimbis Services, Inc.
>>> www.nimbisservices.com
>>>
>>
>>
>>
>> --
>> Joe Topjian
>> Systems Architect
>> Cybera Inc.
>>
>> www.cybera.ca
>>
>> Cybera is a not-for-profit organization that works to spur and support
>> innovation, for the economic benefit of Alberta, through the use
>> of cyberinfrastructure.
>>
>
>
>
> --
> Lorin Hochstein
> Lead Architect - Cloud Services
> Nimbis Services, Inc.
> www.nimbisservices.com
> _______________________________________________
> OpenStack-operators mailing list
> OpenStack-operators [at] lists
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>
>
>


--
Lorin Hochstein
Lead Architect - Cloud Services
Nimbis Services, Inc.
www.nimbisservices.com


robert.plestenjak at xlab

Jul 22, 2013, 12:19 AM

Post #22 of 27 (197 views)
Permalink
Re: CentOS image [In reply to]

1. It should work with LVM.

2. Yes, /boot does mess things up. Script is working under assumption that boot is under /.

- Robert

----- Original Message -----
From: "Lorin Hochstein" <lorin [at] nimbisservices>
To: "Robert Plestenjak" <robert.plestenjak [at] xlab>
Cc: openstack-operators [at] lists
Sent: Sunday, June 30, 2013 8:46:26 PM
Subject: Re: [Openstack-operators] CentOS image


Robert:


This script doesn't support LVM partitions, does it?


Also, I've discovered that it breaks if there's a /boot partition. Apparently, if a boot partition is present then grub prepends a "/boot" to the paths for the kernel and ramdisk, and this script also prepends /boot.


Lorin



On Tue, Jun 11, 2013 at 8:38 AM, Robert Plestenjak < robert.plestenjak [at] xlab > wrote:


Almost forgot, don't forget to install 'wget' and 'openssh-clients'


- Robert

----- Original Message -----

From: "Robert Plestenjak" < robert.plestenjak [at] xlab >
To: openstack-operators [at] lists
Sent: Tuesday, June 11, 2013 11:35:01 AM
Subject: Re: [Openstack-operators] CentOS image



Yes, that would be great.

You can also create image manually in KVM, until proper tools are ready.

1. create disk image with QCOW2 format

qemu-img create -f qcow2 -o preallocation=metadata /extra/libvirt/images/centos-6-cloud.qcow2 2G

2. install centos, I recomend only one partition and no swap (in grizzly, you can set swap size in flavor)

virt-install --name=centos-6-cloud --disk path=/extra/libvirt/images/centos-6-cloud.qcow2,format=qcow2 -r 1024 --vcpus=1 --hvm -c /extra/iso/CentOS-6.3-x86_64-minimal.iso

3. login into your new image and modify '/etc/sysconfig/network-scripts/ifcfg-eth0' to look like this

DEVICE="eth0"
BOOTPROTO="dhcp"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE="Ethernet"

4. add EPEL repository and update OS

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm

5. install cloud-utils and cloud-init

yum update
yum install cloud-utils, cloud-init

6. Download 'centos-image-mod.sh' and 'init-part' together in same directory, run 'centos-image-mod.sh'. This will modify initrd and grub.conf.

6.1. Edit '/boot/grub/grub.conf', check if everything is OK. Also, may not be a bad idea to set timeout to 0.

7. Delete '/etc/udev/rules.d/70-persistent-net.rules', this will be auto created during boot. Don't forget this, since you won't have functional network when you bring this image up on Openstack.

8. Power down your virtual Centos

9. Compress QCOW2 image with

qemu-img convert -c /extra/libvirt/images/centos-6-cloud.qcow2 -O qcow2 /tmp/centos.qcow2


Image /tmp/centos.qcow2 is now ready for upload to Openstack

- Robert


On 16 May 2013 21:08, Robert Plestenjak < robert.plestenjak [at] xlab > wrote:
> This script will modify initrd for image resize during boot, redirect boot log messages to ttyS0 and set NOOP sceduler. Tested on CentOS 6.3 and 6.4.
>
> https://github.com/flegmatik/centos-image-resize

This would be lovely to integrate into diskimage-builder [as part of a
CentOS supporting element].

-Rob

--
Robert Collins < rbtcollins [at] hp >
Distinguished Technologist
HP Cloud Services

_______________________________________________
OpenStack-operators mailing list
OpenStack-operators [at] lists
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators

_______________________________________________
OpenStack-operators mailing list
OpenStack-operators [at] lists
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators




--

Lorin Hochstein

Lead Architect - Cloud Services
Nimbis Services, Inc.
www.nimbisservices.com

_______________________________________________
OpenStack-operators mailing list
OpenStack-operators [at] lists
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators


robert.plestenjak at xlab

Jul 22, 2013, 1:35 AM

Post #23 of 27 (196 views)
Permalink
Re: CentOS image [In reply to]

Looked script again and no, it does not work with LVM. Is there any real need for this? LVM is not really needed for cloud virtual environments (my opinion only).

- Robert

----- Original Message -----
From: "Robert Plestenjak" <robert.plestenjak [at] xlab>
To: openstack-operators [at] lists
Sent: Monday, July 22, 2013 9:19:53 AM
Subject: Re: [Openstack-operators] CentOS image

1. It should work with LVM.

2. Yes, /boot does mess things up. Script is working under assumption that boot is under /.

- Robert

----- Original Message -----
From: "Lorin Hochstein" <lorin [at] nimbisservices>
To: "Robert Plestenjak" <robert.plestenjak [at] xlab>
Cc: openstack-operators [at] lists
Sent: Sunday, June 30, 2013 8:46:26 PM
Subject: Re: [Openstack-operators] CentOS image


Robert:


This script doesn't support LVM partitions, does it?


Also, I've discovered that it breaks if there's a /boot partition. Apparently, if a boot partition is present then grub prepends a "/boot" to the paths for the kernel and ramdisk, and this script also prepends /boot.


Lorin



On Tue, Jun 11, 2013 at 8:38 AM, Robert Plestenjak < robert.plestenjak [at] xlab > wrote:


Almost forgot, don't forget to install 'wget' and 'openssh-clients'


- Robert

----- Original Message -----

From: "Robert Plestenjak" < robert.plestenjak [at] xlab >
To: openstack-operators [at] lists
Sent: Tuesday, June 11, 2013 11:35:01 AM
Subject: Re: [Openstack-operators] CentOS image



Yes, that would be great.

You can also create image manually in KVM, until proper tools are ready.

1. create disk image with QCOW2 format

qemu-img create -f qcow2 -o preallocation=metadata /extra/libvirt/images/centos-6-cloud.qcow2 2G

2. install centos, I recomend only one partition and no swap (in grizzly, you can set swap size in flavor)

virt-install --name=centos-6-cloud --disk path=/extra/libvirt/images/centos-6-cloud.qcow2,format=qcow2 -r 1024 --vcpus=1 --hvm -c /extra/iso/CentOS-6.3-x86_64-minimal.iso

3. login into your new image and modify '/etc/sysconfig/network-scripts/ifcfg-eth0' to look like this

DEVICE="eth0"
BOOTPROTO="dhcp"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE="Ethernet"

4. add EPEL repository and update OS

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm

5. install cloud-utils and cloud-init

yum update
yum install cloud-utils, cloud-init

6. Download 'centos-image-mod.sh' and 'init-part' together in same directory, run 'centos-image-mod.sh'. This will modify initrd and grub.conf.

6.1. Edit '/boot/grub/grub.conf', check if everything is OK. Also, may not be a bad idea to set timeout to 0.

7. Delete '/etc/udev/rules.d/70-persistent-net.rules', this will be auto created during boot. Don't forget this, since you won't have functional network when you bring this image up on Openstack.

8. Power down your virtual Centos

9. Compress QCOW2 image with

qemu-img convert -c /extra/libvirt/images/centos-6-cloud.qcow2 -O qcow2 /tmp/centos.qcow2


Image /tmp/centos.qcow2 is now ready for upload to Openstack

- Robert


On 16 May 2013 21:08, Robert Plestenjak < robert.plestenjak [at] xlab > wrote:
> This script will modify initrd for image resize during boot, redirect boot log messages to ttyS0 and set NOOP sceduler. Tested on CentOS 6.3 and 6.4.
>
> https://github.com/flegmatik/centos-image-resize

This would be lovely to integrate into diskimage-builder [as part of a
CentOS supporting element].

-Rob

--
Robert Collins < rbtcollins [at] hp >
Distinguished Technologist
HP Cloud Services

_______________________________________________
OpenStack-operators mailing list
OpenStack-operators [at] lists
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators

_______________________________________________
OpenStack-operators mailing list
OpenStack-operators [at] lists
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators




--

Lorin Hochstein

Lead Architect - Cloud Services
Nimbis Services, Inc.
www.nimbisservices.com

_______________________________________________
OpenStack-operators mailing list
OpenStack-operators [at] lists
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators

_______________________________________________
OpenStack-operators mailing list
OpenStack-operators [at] lists
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators


Robert.vanLeeuwen at spilgames

Jul 23, 2013, 5:42 AM

Post #24 of 27 (188 views)
Permalink
Re: CentOS image [In reply to]

> Dean Troyer has some great CentOS build scripts here. These scripts will build a CentOS
> image on the fly from start to finish. The only issue I ran into was with udev: On first boot,
> udev will record the MAC addresses of the virtual NIC(s) in the instance. If you create a
> snapshot, these records are not removed and so udev renames the interfaces to something else.

Maybe not the most elegant solution but it works (at least for machines with one interface):
symlink /etc/udev/rules.d/75-persistent-net-generator.rules to /dev/null :)

Cheers,
Robert van Leeuwen
_______________________________________________
OpenStack-operators mailing list
OpenStack-operators [at] lists
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators


robert.plestenjak at xlab

Jul 23, 2013, 7:41 AM

Post #25 of 27 (188 views)
Permalink
Re: CentOS image [In reply to]

Yeah, that should work, great idea :)

- Robert

----- Original Message -----
From: "Robert van Leeuwen" <Robert.vanLeeuwen [at] spilgames>
To: "Joe Topjian" <joe.topjian [at] cybera>, openstack-operators [at] lists
Sent: Tuesday, July 23, 2013 2:42:48 PM
Subject: Re: [Openstack-operators] CentOS image

> Dean Troyer has some great CentOS build scripts here. These scripts will build a CentOS
> image on the fly from start to finish. The only issue I ran into was with udev: On first boot,
> udev will record the MAC addresses of the virtual NIC(s) in the instance. If you create a
> snapshot, these records are not removed and so udev renames the interfaces to something else.

Maybe not the most elegant solution but it works (at least for machines with one interface):
symlink /etc/udev/rules.d/75-persistent-net-generator.rules to /dev/null :)

Cheers,
Robert van Leeuwen
_______________________________________________
OpenStack-operators mailing list
OpenStack-operators [at] lists
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators

_______________________________________________
OpenStack-operators mailing list
OpenStack-operators [at] lists
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators

First page Previous page 1 2 Next page Last page  View All OpenStack operators RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.