[Openstack-operators] Problem creating resizable CentOS 6.5 image

Alvise Dorigo alvise.dorigo at pd.infn.it
Fri Oct 3 08:01:22 UTC 2014


Hi,
I'm creating an CentOS 6.5 image with OZ and following the guide here:

http://docs.openstack.org/image-guide/content/ch_openstack_images.html

In particular I made sure that the kickstart creates only one partition 
( "/" ) which fills all the available initial image space. Then I made 
sure to install the 3 packages

cloud-init
cloud-utils
cloud-utils-growpart

as clearly mentioned in the web page linked above.

When I launch the image with small flavor (20GB disk size), it's "/" 
file system is 2GB large.

What am I doing wrong ?

thanks,

     Alvise


P.S. In the following the kickstart and the oz-template files:

===== KICKSTART =====
install
url --url http://mirror3.mirror.garr.it/mirrors/CentOS/6/os/x86_64/
text
key --skip
keyboard it
lang en_US.UTF-8
skipx
network --bootproto dhcp
rootpw --plaintext XXXXXXX

# authconfig
authconfig --enableshadow --enablemd5

selinux --disabled
#service --enabled=ssh
timezone --utc Europe/Rome

bootloader --location=mbr --append="console=tty0 console=ttyS0,115200"
zerombr yes
clearpart --all --initlabel

part / --size=200 --grow
#part / --size=1 --grow

reboot

%packages
@core
@base

===== OZ TEMPLATE =====
<template>
  <name>centos65_x86_64</name>
  <description>CentOS Linux 6.5 x86_64 template</description>
  <disk>
    <size>2G</size>
  </disk>
  <os>
   <name>CentOS-6</name>
   <version>5</version>
   <arch>x86_64</arch>
   <install type='iso'>
<iso>file:///Images/CentOS_Mirror/CentOS-6.4-x86_64-minimal.iso</iso>
   </install>
  </os>

  <files>

    <file name="/etc/sysconfig/network">
NETWORKING=yes
NOZEROCONF=yes
    </file>

    <file name="/etc/sysconfig/network-scripts/ifcfg-eth0">
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
TYPE=Ethernet
    </file>

  </files>

  <repositories>
   <repository name='epel-6'>
<url>http://vesta.informatik.rwth-aachen.de/ftp/pub/Linux/fedora-epel/6/$basearch</url>
     <signed>False</signed>
   </repository>


  </repositories>
  <packages>
    <package name="cloud-init"/>
    <package name="cloud-utils"/>
    <package name="cloud-initramfs-growroot"/>
  </packages>

  <commands>

   <command name="removeudevnet">
echo -n > /etc/udev/rules.d/70-persistent-net.rules
echo -n > /lib/udev/rules.d/75-persistent-net-generator.rules
   </command>

   <command name="epel">
rpm --import http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL
rpm --import http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6
rpm -ivh 
http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
   </command>

   <command name="ec2user">
adduser ec2-user -G adm,wheel
   </command>

   <command name="nopwdwheel">
echo "%wheel        ALL=(ALL)       NOPASSWD: ALL" >> /etc/sudoers
   </command>

   <command name="lockroot">
/usr/bin/passwd -d root || :
/usr/bin/passwd -l root || :
   </command>

   <command name="nofirewall">
iptables -F
echo -n > /etc/sysconfig/iptables
   </command>

</commands>

</template>





More information about the OpenStack-operators mailing list