1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214
|
.TH build\-openstack\-debian\-image 1
.SH NAME
build\-openstack\-debian\-image \- build a Debian image to be used with OpenStack
.SH SYNOPSIS
.B build\-openstack\-debian\-image
.B \-\-release|\-r <jessie|wheezy>
[ OPTIONS ]
.SH DESCRIPTION
.LP
The
.I build\-openstack\-debian\-image
shell script will build a Debian image which can be used in an OpenStack IaaS
cloud. The resulting (Qcow2 and raw images) contains initramfs\-growroot so
that the root partition will be resized (during the initramfs phase, before
mouting anything) to match the flavor selected when using "nova boot". Later on
during the boot process, cloud\-init will resize the root partition on the fly
(resize is performed when the partition is already mounted read\-write, since
recent kernel allow that for ext3).
Cloud\-init is setup to use an Ec2 metadata server, which is what OpenStack is
compatible with. A "debian" (configurable with the use of the
.B --login
option) user will be used to receive the ssh key from the user data blob.
This user is setup without a password (eg: adduser \-\-disabled\-password).
Once logged as this "debian" user in your new virtual machine, you can
"sudo" to root from that user, without needing a password. The root
password is "password" by default, and ssh into the root user without
using an ssh keypair is disabled by default (PermitRootLogin without-password
is set in /etc/ssh/sshd_config).
.SH "PARAMETERS"
.LP
.B \-\-release|\-r
.I wheezy|jessie
.IP
Sets the
.I release
name to be installed. Currently only 2 values a possible:
.I wheezy
and
.I jessie.
.SH "OPTIONS"
.LP
.B \-\-extra\-packages|\-e
.I PACKAGE,PACKAGE,...
.IP
Select the
.I PACKAGE
you want to add to the image
.I default is: bash-completion,joe,most,screen,less,vim,bzip2
Note that this list of extra packages isn't used if you use the
.B --minimal
option.
.LP
.B \-\-debootstrap\-url|\-u
.I <debootstrap\-debian\-mirror>
.IP
Select the
.I URL
of the Debian mirror to use to perform the debootstrap. For example:
.I http://ftp.fr.debian.org/debian
.LP
.B \-\-boot-manager|\-bm
.I <grub|syslinux>
.IP
Select what type of boot manager to use inside the image. The default is
Grub, but you can as well decide to use syslinux if you prefer.
.LP
.B \-\-boot-type|\-bt
.I <mbr|uefi>
.IP
Select how to boot the image: using legacy MBR-style (aka BIOS or CSM)
boot, or UEFI. The default is mbr. Selecting uefi requires the use of
Grub as the boot manager, and will set up an extra EFI System
Partition inside the image to support UEFI boot.
.LP
.B \-\-architecture|\-
.I <amd64|arm64>
.IP
Select the architecture to target for the output image. This will not
cross build for that architecture, but will pick the right
architecture-specific components. Supported options are "amd64" and
"arm64"; "amd64" is default.
.LP
.B \-\-sources.list\-mirror|\-s
.I <source\-list\-mirror>
.IP
URL to use when building the sources.list inside the chroot. If this
option is omitted, then the global httpredir.debian.org redirector is used.
For example, you can use:
.I http://ftp.fr.debian.org/debian
.LP
.B \-\-minimal
.IP
Without this option, the following packages will also be installed:
bash\-completion (and /etc/bash.bashrc will be setup to use bash\-completion),
joe (the text editor), most, GNU screen, less and vim. If you believe that
more things should be added in the non\-minimal image, suggestions are
welcome.
.LP
.B \-\-azure|\-az
.IP
Build an image for the Microsoft Azure cloud. Note that this option
is incompatible with the \-\-automatic-resize|\-ar option, which will
be ignored.
.LP
.B \-\-image-size|\-is
.I <image\-size>
.IP
Select the image size (default to 2 GBytes if this option is omitted). Only
useful if you need to use a custom script hook (see below).
.LP
.B \-\-automatic-resize|\-ar
.IP
Reduce the image to the minimum HDD size possible. The partition of the
image will be first shrinked with resize2fs \-M, then the space it takes will
be used to do a 2nd resize2fs adding a bit of extra space for the operating
system to write runtime data (see below). Since this option takes a lot of
time, it is disabled by default.
.LP
.B \-\-automatic\-resize\-space|\-ars
.I <supplementary-space>
.IP
Size of the supplementary space added to the partition after it is resized
to the minimum. If this option is omitted, then 50G is used. If
.B \-\-automatic-resize
isn't used, then it is useless to set this option, which will be ignored.
.LP
.B \-\-login|\-l
.I <user-login>
.IP
Change the login name (default to debian) for the user created by Cloud-Init.
.LP
.B \-\-password|\-p
.I <root-password>
.IP
Defines a default root password for your image. This option is dangerous,
first because it will show the root password to the user of the computer
building the image if using "ps", then also because it is best to not set
a default root password at all if possible. However, this option is still
there, because sometimes, you need to be able to debug your image, and
login through the web console of horizon. In a production environment, do
not use this option.
.LP
.B \-\-hook\-script|\-hs
.I <hook-script>
.IP
If you wish to further customize the generated cloud image, you can use a
hook script. When called, build-openstack-debian-image will fill up some
BODI_* environment variable for the hook script to use as per below:
.B BODI_CHROOT_PATH
path where the image is mounted
.B BODI_RELEASE
name of the Debian release that is being bootstraped
.SH EXAMPLE
.IP
.IP
Here is an example with the short parameter names:
.LP
.I build\-openstack\-debian\-image \-u http://ftp.fr.debian.org/debian \-s \
http://ftp.fr.debian.org/debian \-is 5 \-e libapache2\-mod\-php5 \-hs \
~/customize\-my\-image \-ar \-ars 100
.IP
And the same but with long names for options:
.LP
.I build-openstack-debian-image \-\-debootstrap\-url http://ftp.fr.debian.org/debian \
\-\-sources.list\-mirror http://ftp.fr.debian.org/debian \-\-image-size 5 \
\-\-extra\-packages libapache2-mod-php5 \-\-hook\-script ~/customize\-my\-image \
\-\-automatic-resize \-\-automatic\-resize\-space 100
.SH AUTHORS
build\-openstack\-debian\-image has been written by Thomas Goirand
<zigo@debian.org>, with contributions from Mehdi Abaakouk
<sileht@sileht.net>.
|