Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
snf-image
Commits
f4673cc0
Commit
f4673cc0
authored
Jun 02, 2014
by
Nikos Skalkotos
Browse files
Merge branch 'hotfix-0.15.1'
parents
ebc5e599
0dabfa03
Changes
13
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
f4673cc0
2014-16-05, v0.15
2014-06-02, v0.15.1
* Remove support for OS API version 5, 10, 15
* Make img_passwd an optional parameter
* Allow OS parameters to be defined in /etc/default/snf-image and the
variants files.
* Fix bugs, typos and update the documentation
2014-05-16, v0.15
* Add support for selectable pithos storage backend. Possible storage
backends for pithos are `nfs' or `rados'
* Fix bugs, typos and update the documentation
...
...
docs/architecture.rst
View file @
f4673cc0
...
...
@@ -235,7 +235,8 @@ only environment variable required is *SNF_IMAGE_TARGET*.
| | | | |HOSTNAME |PROPERTY_OSFAMILY |
+-------------------------------+---+------------------+-------------------------+-------------------------+------------------------+
|ChangePassword |50 |InstallUnattend |EnforcePersonality |TARGET |PROPERTY_USERS |
| | | | |PASSWORD |PROPERTY_OSFAMILY |
| | | | | |PROPERTY_OSFAMILY |
| | | | | |PASSWORD |
+-------------------------------+---+------------------+-------------------------+-------------------------+------------------------+
|FilesystemResizeMounted |50 |InstallUnattend |EnforcePersonality |TARGET |PROPERTY_OSFAMILY |
+-------------------------------+---+------------------+-------------------------+-------------------------+------------------------+
...
...
docs/configuration.rst
View file @
f4673cc0
...
...
@@ -9,12 +9,6 @@ some external programs in ``/etc/default/snf-image``:
# snf-image defaults file
# IMAGE_NAME: Name of the image to use
# Generally you use the name of the image with the version of the OS included.
# Examples include:
# centos-5.4 debian-4.0 fedora-12
# IMAGE_NAME=""
# IMAGE_DIR: directory location for disk images
# IMAGE_DIR="/var/lib/snf-image"
...
...
docs/interface.rst
View file @
f4673cc0
...
...
@@ -11,8 +11,8 @@ following OS Parameters:
(:ref:`details <image-format>`)
* **img_id** (required if *config_url* is missing): the URI used to identify
the image (:ref:`details <image-id>`)
* **img_passwd** (
required if *config_url* is missing): the password to b
e
injected to the image
* **img_passwd** (
optional): the password to be injected into the imag
e
(:ref:`details <image-passwd>`)
* **img_properties** (optional): additional image properties used to customize
the image (:ref:`details <image-properties>`)
* **img_personality** (optional): files to be injected into the image's file
...
...
@@ -33,7 +33,7 @@ snf-image supports 3 different types of image formats:
These are also the only valid values for the **img_format** OS parameter.
The **diskdump** type is the newest and recommended type. Thus, all sample
images we provide are of this type. For more details about the internals of
image formats please see the
:ref:`
corresponding advanced section
image formats please see the corresponding
:ref:`
advanced section
<image-format-advanced>`.
.. _image-id:
...
...
@@ -83,6 +83,15 @@ to be used. If no prefix is used, it defaults to the local back-end:
To select the Null back-end and skip the fetching and extraction step, we set
``img_id=null``.
.. _image-passwd:
Image Password (img_passwd)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
The value of this parameter is the password to be injected into the image. If
this parameter is not set at all, then the *ChangePassword* task (see
:ref:`Image Configuration Tasks <image-configuration-tasks>`) will not run.
.. _image-properties:
Image Properties (img_properties)
...
...
docs/version.py
View file @
f4673cc0
__version__
=
"0.15"
__version__
=
"0.15
.1
"
snf-image-helper/tasks/50ChangePassword.in
View file @
f4673cc0
...
...
@@ -153,8 +153,9 @@ if [ ! -d "$SNF_IMAGE_TARGET" ]; then
log_error
"Target dir:
\`
$SNF_IMAGE_TARGET
' is missing"
fi
if
[
-z
"
$SNF_IMAGE_PASSWORD
"
]
;
then
log_error
"Password is missing"
if
[
-z
"
${
SNF_IMAGE_PASSWORD
+dummy
}
"
]
;
then
warn
"Task
${
PROGNAME
:2
}
will not run. Password is not set"
exit
0
fi
#trim users var
...
...
snf-image-host/common.sh.in
View file @
f4673cc0
# Copyright (C) 2011 GRNET S.A.
# Copyright (C) 2011
-2014
GRNET S.A.
# Copyright (C) 2007, 2008, 2009 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
...
...
@@ -85,39 +85,6 @@ send_errors() {
eval "echo $(printf "%q" "$report") >&${MONITOR_FD}"
}
get_api5_arguments() {
GETOPT_RESULT=$*
# Note the quotes around `$TEMP': they are essential!
eval set -- "$GETOPT_RESULT"
while true; do
case "$1" in
-i|-n) instance=$2; shift 2;;
-o) old_name=$2; shift 2;;
-b) blockdev=$2; shift 2;;
-s) swapdev=$2; shift 2;;
--) shift; break;;
*) log_error "Internal error!" >&2; exit 1;;
esac
done
if [ -z "$instance" -o -z "$blockdev" ]; then
log_error "Missing OS API Argument (-i, -n, or -b)"
exit 1
fi
if [ "$SCRIPT_NAME" != "export" -a -z "$swapdev" ]; then
log_error "Missing OS API Argument -s (swapdev)"
exit 1
fi
if [ "$SCRIPT_NAME" = "rename" -a -z "$old_name" ]; then
log_error "Missing OS API Argument -o (old_name)"
exit 1
fi
}
get_api10_arguments() {
if [ -z "$INSTANCE_NAME" -o -z "$HYPERVISOR" -o -z "$DISK_COUNT" ]; then
log_error "Missing OS API Variable:"
...
...
@@ -128,7 +95,7 @@ get_api10_arguments() {
case $HYPERVISOR in
xen-hvm|xen-pvm) . xen-common.sh ;;
kvm) . kvm-common.sh ;;
*) log_error "Unsupported hypervisor: \`$HYPERVIS
T
OR'"; exit 1;;
*) log_error "Unsupported hypervisor: \`$HYPERVISOR'"; exit 1;;
esac
instance=$INSTANCE_NAME
...
...
@@ -162,12 +129,18 @@ get_api20_arguments() {
get_api10_arguments
if [ "$SCRIPT_NAME" = "create" ]; then
local
required_
osparams="IMG_ID IMG_FORMAT IMG_PASSWD"
local osp
arams="$required_osparams IMG_PROPERTIES IMG_PERSONALITY CONFIG_URL"
local osparams="IMG_ID IMG_FORMAT IMG_PASSWD
IMG_PROPERTIES IMG_PERSONALITY CONFIG_URL
"
local osp
# Store OSP_VAR in VAR
for param in $osparams; do
eval $param=\"\$OSP_$param\"
# This is black magic. Only execute the eval command if the "param"
# variable is set. This way we can distinguish between variables
# with value "" and variables that have not been set at all
osp="OSP_$param"
if [ -n "${!osp+dummy}" ]; then
eval $param=\"\$$osp\"
fi
done
if [ -n "$CONFIG_URL" ]; then
...
...
@@ -177,16 +150,20 @@ get_api20_arguments() {
config_params=$(./decode-config.py $osparams <<< "$config")
eval "$config_params"
fi
for var in $required_osparams; do
if [ -z "${!var}" ]; then
log_error "Missing OS API Parameter: ${var}"
exit 1
fi
done
fi
}
parameter_check() {
local required_osparams="IMG_ID IMG_FORMAT"
for var in $required_osparams; do
if [ -z "${!var}" ]; then
log_error "Missing OS API Parameter: ${var}"
exit 1
fi
done
}
map_disk0() {
blockdev="$1"
filesystem_dev_base=$($KPARTX -l -s -p- $blockdev | \
...
...
@@ -286,25 +263,19 @@ canonicalize() {
fi
}
# this one is only to be called by
create
# this one is only to be called by
ganeti OS interface scripts
ganeti_os_main() {
if [ -z "$OS_API_VERSION" -o "$OS_API_VERSION" = "5" ]; then
OS_API_VERSION=5
GETOPT_RESULT=`getopt -o o:n:i:b:s: -n '$0' -- "$@"`
if [ $? != 0 ] ; then log_error "Terminating..."; exit 1 ; fi
get_api5_arguments $GETOPT_RESULT
elif [ "$OS_API_VERSION" = "10" -o "$OS_API_VERSION" = "15" ]; then
get_api10_arguments
elif [ "$OS_API_VERSION" = "20" ]; then
get_api20_arguments
IMAGE_NAME="$IMG_ID"
IMAGE_TYPE="$IMG_FORMAT"
BACKEND_TYPE=$(get_backend_type $IMG_ID)
else
log_error "Unknown OS API VERSION $OS_API_VERSION"
if [ "$OS_API_VERSION" != "20" ]; then
log_error "Unknown OS API VERSION $OS_API_VERSION. Only OS API VERSION 20 is supported"
exit 1
fi
source_variant
get_api20_arguments
}
source_variant() {
if [ -n "$OS_VARIANT" ]; then
if [ ! -d "$VARIANTS_DIR" ]; then
log_error "OS Variants directory $VARIANTS_DIR doesn't exist"
...
...
@@ -315,7 +286,7 @@ ganeti_os_main() {
. "$VARIANT_CONFIG"
else
if grep -qxF "$OS_VARIANT" variants.list; then
log_error "ERROR:
instance
-image configuration error"
log_error "ERROR:
snf
-image configuration error"
log_error " Published variant $OS_VARIANT is missing its" \
"config file"
log_error " Please create $VARIANT_CONFIG or unpublish the" \
...
...
snf-image-host/create
View file @
f4673cc0
#!/bin/bash
# Copyright (C) 2011 GRNET S.A.
# Copyright (C) 2011
-2014
GRNET S.A.
#
# 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
...
...
@@ -24,6 +24,12 @@ set -o pipefail
ganeti_os_main
parameter_check
IMAGE_NAME
=
"
$IMG_ID
"
IMAGE_TYPE
=
"
$IMG_FORMAT
"
BACKEND_TYPE
=
$(
get_backend_type
$IMG_ID
)
if
[
"
$IMAGE_DEBUG
"
=
"yes"
]
;
then
PS4
=
'$(date "+%s.%N ($LINENO) + ")'
set
-x
...
...
@@ -70,6 +76,7 @@ case $BACKEND_TYPE in
if
[
!
-d
"
$canonical_image_dir
"
]
;
then
log_error
"The IMAGE_DIR directory:
\`
$IMAGE_DIR
' does not exist."
report_error
"Unable to retrieve image file."
exit
1
fi
image_file
=
"
$IMAGE_DIR
/
$IMAGE_NAME
"
...
...
@@ -174,8 +181,12 @@ floppy=$(mktemp --tmpdir floppy.XXXXXX)
add_cleanup
rm
"
$floppy
"
snf_export_TYPE
=
"
$IMG_FORMAT
"
snf_export_PASSWORD
=
"
$IMG_PASSWD
"
snf_export_HOSTNAME
=
"
$instance
"
if
[
-n
"
${
IMG_PASSWD
+dummy
}
"
]
;
then
snf_export_PASSWORD
=
"
$IMG_PASSWD
"
fi
if
[
-n
"
$IMG_PROPERTIES
"
]
;
then
snf_export_PROPERTIES
=
"
$IMG_PROPERTIES
"
fi
...
...
snf-image-host/defaults.in
View file @
f4673cc0
# snf-image defaults file
# IMAGE_NAME: Name of the image to use
# Generally you use the name of the image with the version of the OS included.
# Examples include:
# centos-5.4 debian-4.0 fedora-12
# IMAGE_NAME=""
# IMAGE_DIR: directory location for disk images
# IMAGE_DIR="@localstatedir@/lib/snf-image"
...
...
snf-image-host/ganeti_api_version
View file @
f4673cc0
20
15
10
5
snf-image-host/verify
View file @
f4673cc0
...
...
@@ -23,14 +23,22 @@ set -e
check_required
()
{
local
required_params
=
"IMG_ID IMG_FORMAT IMG_PASSWD"
local
osparams
=
"
$required_params
IMG_PROPERTIES IMG_PERSONALITY CONFIG_URL"
local
required_params
=
"IMG_ID IMG_FORMAT"
local
osparams
=
"
$required_params
IMG_PASSWD IMG_PROPERTIES IMG_PERSONALITY CONFIG_URL"
local
osp
source_variant
# Store OSP_VAR in VAR
for
param
in
$osparams
;
do
eval
$param
=
\"\$
OSP_
$param
\"
# Only do the evaluation if OSP_$param is defined
osp
=
"OSP_
$param
"
if
[
-n
"
${
!osp+dummy
}
"
]
;
then
eval
$param
=
\"\$
$osp
\"
fi
done
for
var
in
$required_params
;
do
if
[
-z
"
${
!var
}
"
]
;
then
log_error
"Missing OS API Parameter:
${
var
}
"
...
...
version
View file @
f4673cc0
0.15
0.15
.1
version.m4
View file @
f4673cc0
m4_define([devflow_version], [0.15])
m4_define([devflow_version], [0.15
.1
])
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment