Skip to content

Commit

Permalink
Renamed q-image-create to q-image-maker.
Browse files Browse the repository at this point in the history
  • Loading branch information
hoylen committed Apr 24, 2021
1 parent 84fbb0b commit 806abce
Show file tree
Hide file tree
Showing 6 changed files with 216 additions and 206 deletions.
14 changes: 7 additions & 7 deletions openstack-images/README-linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,17 @@ working directory.

#### 1c. Get the script

Get a copy of the _q-image-create.sh_ script onto the creation
Get a copy of the _q-image-maker.sh_ script onto the creation
host. This can be done by uploading it or downloading it. The example
below downloads it from the GitHub respository. Note: if GitHub
changes the raw download URL, find out its new value from the [project
in GitHub](https://github.com/qcif/cloud-utils).

[creator@host]$ cd /mnt/creator
[creator@host]$ curl -O https://raw.githubusercontent.com/qcif/cloud-utils/master/q-image-create.sh
[creator@host]$ chmod a+x q-image-create.sh
[creator@host]$ curl -O https://raw.githubusercontent.com/qcif/cloud-utils/master/q-image-maker.sh
[creator@host]$ chmod a+x q-image-maker.sh

The _q-image-create.sh_ script is just a convenient way to invoke the
The _q-image-maker.sh_ script is just a convenient way to invoke the
_qemu-kvm_ and _glance_ commands.

### Step 2: Install the guest system from the ISO
Expand All @@ -70,7 +70,7 @@ QEMU Copy-On-Write version 2 (QCOW2) format, and the VNC server is
listening on display 0 (port 5900). If needed, these defaults can be
changed using command line options.

[creator@host]$ ./q-image-create.sh create \
[creator@host]$ ./q-image-maker.sh create \
--iso CentOS-6.5-x86_64-minimal.iso \
disk.qcow2

Expand Down Expand Up @@ -324,7 +324,7 @@ accessed by typing Ctrl-Alt-2 into the VNC client).
If additional configuration needs to be performed, restart the guest
virtual machine by booting off the disk image.

$ ./q-image-create.sh --run disk.qcow2
$ ./q-image-maker.sh --run disk.qcow2

As before, connect to the VNC server (through the ssh tunnel) with an
empty password.
Expand Down Expand Up @@ -356,7 +356,7 @@ to upload.

Upload the disk image, optionally giving it a name:

[creator@host]$ ./q-image-create.sh upload --name "My CentOS image"
[creator@host]$ ./q-image-maker.sh upload --name "My CentOS image"
--min-disk 10 disk.qcow2


Expand Down
12 changes: 6 additions & 6 deletions openstack-images/README-windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ https://github.com/virtio-win/virtio-win-pkg-scripts/blob/master/README.md

#### 1d. Get the script

Get a copy of the _q-image-create.sh_ script onto the creation
Get a copy of the _q-image-maker.sh_ script onto the creation
host. This can be done by uploading it or downloading it. The example
below downloads it from the GitHub respository. Note: if GitHub
changes the raw download URL, find out its new value from the [project
in GitHub](https://github.com/qcif/cloud-utils).

[creator@host]$ cd /mnt/creator
[creator@host]$ curl -O https://raw.githubusercontent.com/qcif/cloud-utils/master/q-image-create.sh
[creator@host]$ chmod a+x q-image-create.sh
[creator@host]$ curl -O https://raw.githubusercontent.com/qcif/cloud-utils/master/q-image-maker.sh
[creator@host]$ chmod a+x q-image-maker.sh

### Step 2: Install the guest system from the ISO

Expand All @@ -91,7 +91,7 @@ in GitHub](https://github.com/qcif/cloud-utils).
Create an disk image, and run a virtual machine with it and the two
ISO images:

[creator@host]$ ./q-image-create.sh create --iso windows.iso --iso virtio-win.iso \
[creator@host]$ ./q-image-maker.sh create --iso windows.iso --iso virtio-win.iso \
--size 30 image.qcow2

The disk image **must** be large enough to hold the operating system
Expand Down Expand Up @@ -325,7 +325,7 @@ Turn on automatic updates and install the current updates.
If additional configuration needs to be performed, restart the guest
virtual machine by booting off the disk image.

$ ./q-image-create.sh --run image.qcow2
$ ./q-image-maker.sh --run image.qcow2

As before, connect to the VNC server (through the ssh tunnel) without
using a VNC password.
Expand Down Expand Up @@ -442,7 +442,7 @@ Sysprep must be rerun on it.

Upload the disk image, optionally giving it a name:

[creator@host]$ ./q-image-create.sh upload --windows --name "My new image" image.qcow2
[creator@host]$ ./q-image-maker.sh upload --windows --name "My new image" image.qcow2

The `--windows` option sets the "os_type" property on the image. It
controls the behaviour when the image is used. For example, instances
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
q-image-create
==============
q-image-maker
=============

Utility to help make virtual machine image for use on Openstack.

Synopsis
--------

q-image-make.sh command [options] diskImage
q-image-maker.sh command [options] diskImage

Description
-----------
Expand All @@ -19,7 +19,7 @@ While the QEMU and OpenStack can be used directly, this script makes
the image creation and uploading process easier, by invoking them with
the necessary options.

Usage: q-image-make.sh [create|run|upload] [options] diskImage
Usage: q-image-maker.sh [create|run|upload] [options] diskImage

Available commands:

Expand Down Expand Up @@ -59,8 +59,8 @@ Examples
Guides are available to show the use of this script for creating
images for:

- [CentOS 6.5](image-linux.md)
- [Windows Server 2020](image-windows.md)
- [Linux](README-linux.md)
- [Windows](README-windows.md)

Requirements
------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
#
# To create a disk image:
#
# q-image-create.sh create --iso install-disc.iso example.qcow2
# q-image-maker.sh create --iso install-disc.iso example.qcow2
#
# To upload an disk image to Openstack:
#
# q-image-create.sh upload example.qcow2
# q-image-maker.sh upload example.qcow2
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -93,14 +93,14 @@ if [ -n "$HAS_GNU_ENHANCED_GETOPT" ]; then
# Use GNU enhanced getopt
if ! getopt --name "$EXE" --long $LONG_OPTS --options $SHORT_OPTS -- "$@" >/dev/null; then
echo "$EXE: usage error (use -h or --help for help)" >&2
exit $STATUS_USAGE_ERROR
exit "$STATUS_USAGE_ERROR"
fi
ARGS=$(getopt --name "$EXE" --long $LONG_OPTS --options $SHORT_OPTS -- "$@")
else
# Use original getopt (no long option names, no whitespace, no sorting)
if ! getopt $SHORT_OPTS "$@" >/dev/null; then
echo "$EXE: usage error (use -h for help)" >&2
exit $STATUS_USAGE_ERROR
exit "$STATUS_USAGE_ERROR"
fi
ARGS=$(getopt $SHORT_OPTS "$@")
fi
Expand Down Expand Up @@ -407,8 +407,8 @@ EOF
sleep 3
if ! ps $QEMU_PID > /dev/null; then
# QEMU process no longer running
cat $LOGFILE
rm $LOGFILE
cat "$LOGFILE"
rm "$LOGFILE"
echo "$EXE: error: QEMU failed" 2>&1
exit 1
fi
Expand Down Expand Up @@ -567,7 +567,7 @@ do_upload() {
INSTANCE_MIN_DISK_GIB=$MIN_GIB_NEEDED
else
# Value provided: check it is not smaller than the size indicated by the image file
if [ $INSTANCE_MIN_DISK_GIB -lt $MIN_GIB_NEEDED ]; then
if [ "$INSTANCE_MIN_DISK_GIB" -lt "$MIN_GIB_NEEDED" ]; then
echo "$EXE: error: minimum disk size too small: $INSTANCE_MIN_DISK_GIB GiB (need at least ${MIN_GIB_NEEDED} GiB)" >&2
exit 1
fi
Expand Down Expand Up @@ -605,8 +605,8 @@ EOF
--file "$IMAGE" \
--progress \
--private \
--min-disk $INSTANCE_MIN_DISK_GIB \
--min-ram $INSTANCE_MIN_RAM_MIB \
--min-disk "$INSTANCE_MIN_DISK_GIB" \
--min-ram "$INSTANCE_MIN_RAM_MIB" \
--project "$OS_PROJECT_ID" \
--property os_type=$OS_TYPE \
"$IMAGE_NAME" ; then
Expand Down
Loading

0 comments on commit 806abce

Please sign in to comment.