Commit af835dc3 authored by Nikos Skalkotos's avatar Nikos Skalkotos

Merge branch 'master' into debian

parents 6894bcf8 ef30380d
......@@ -2,3 +2,4 @@
build/
dist/
*.egg-info
docs/_build
MAIN DEVELOPERS:
Nikos Skalkotos <skalkoto@grnet.gr>
CONTRIBUTORS:
Alex Pyrgiotis <apyrgio@cslab.ece.ntua.gr>
Vangelis Koukis <vkoukis@grnet.gr>
Giannis Spiliopoulos <gspilio@admin.grnet.gr>
Konstantinos Tompoulidis <kostikas@grnet.gr>
Copyright 2012, 2013 GRNET S.A. All rights reserved.
Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the following
conditions are met:
1. Redistributions of source code must retain the above
copyright notice, this list of conditions and the following
disclaimer.
2. Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and
documentation are those of the authors and should not be
interpreted as representing official policies, either expressed
or implied, of GRNET S.A.
2013-05-27, v0.3
* Support media hosting FreeBSD systems
* Check if remote files exist when uploading images to pithos
* Make the md5sum and metadate files public if image gets registered as
public
* Fix minor bugs and typos
2013-05-01, v0.2.10
* Fix a bug where acl and user_xattr mount options where not respected
in host bundling operation
2013-04-25, v0.2.9
* Support kamaki 0.8
* Fix a bug in util.get_command()
* Move some linux specific code from unix.py to linux.py
2013-03-28, v0.2.8
* Fix a bug in wizard mode
* Cleanup and refine the code
2013-03-21, v0.2.7
* Fix a bug in host bundling mode where some files were erroneously
excluded from the image
* Fix a bug were snf-image-creator tried to verify the token even when
-t option was not defined by the user
2013-03-19, v0.2.6
* Fix a bug in host bundling mode where the permissions of /tmp and
/var/tmp were not respected
2013-03-19, v0.2.5
* Add support for private images
* Only use the token to authenticate to synnefo
* Show the user-provided info in the confirmation dialog of the wizard
* Fix minor typos & bugs
2013-03-06, v0.2.4
* Rename README.rst to README
* Enforce raw image format in libguestfs
* User user id instead of e-mail when authentication with synnefo
2013-01-30, v0.2.3
* Add support for gpt partition tables in bundle volume
* Add AUTHORS ChangeLog and man pages
* support pyparted 3.4 and python 2.6
2013-01-22, v0.2.2
* Fix bugs in bundle_host and cleanup functions
2013-01-16, v0.2.1
* Fix bug in dialog
* Support python-sendfile 2.x
2013-01-14, v0.2
* Add support for bundling the host system
* Add new tmpdir option for specifying a temporary directory
* Add .kamakirc as sensitive userdatat in cleanup_userdata sysprep
* Fix typos & bugs
2012-12-03, v0.1.1
* Fix bugs in dialog wizard
* Fix typos
2012-11-05, v0.1
* Initial Version
include image_creator/help/*.rst
include README COPYRIGHT AUTHORS ChangeLog
recursive-include docs *
prune docs/_build
README
======
snf-image-creator
=================
snf-image-creator is a command line tool for creating OS images to be used with
synnefo.
......
......@@ -3,7 +3,8 @@
# snf-image-creator documentation build configuration file, created by
# sphinx-quickstart on Mon Oct 8 12:34:17 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
# This file is execfile()d with the current directory set to its containing
# dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
......@@ -11,20 +12,21 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys, os
import sys
import os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# -- General configuration -----------------------------------------------------
# -- General configuration ----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = []
# Add any paths that contain templates here, relative to this directory.
......@@ -41,16 +43,16 @@ master_doc = 'index'
# General information about the project.
project = u'snf-image-creator'
copyright = u'2012, GRNET'
copyright = u'2012, 2013 GRNET S.A. All rights reserved'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.1'
version = '0.3'
# The full version, including alpha/beta/rc tags.
release = '0.1'
release = '0.3'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
......@@ -66,7 +68,8 @@ release = '0.1'
# directories to ignore when looking for source files.
exclude_patterns = ['_build']
# The reST default role (used for this markup: `text`) to use for all documents.
# The reST default role (used for this markup: `text`) to use for all
# documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
......@@ -87,7 +90,7 @@ pygments_style = 'sphinx'
#modindex_common_prefix = []
# -- Options for HTML output ---------------------------------------------------
# -- Options for HTML output --------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
......@@ -96,7 +99,27 @@ html_theme = 'default'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
html_theme_options = {
'collapsiblesidebar': 'true',
'footerbgcolor': '#55b577',
'footertextcolor': '#000000',
'sidebarbgcolor': '#ffffff',
'sidebarbtncolor': '#f2f2f2',
'sidebartextcolor': '#000000',
'sidebarlinkcolor': '#328e4a',
'relbarbgcolor': '#55b577',
'relbartextcolor': '#ffffff',
'relbarlinkcolor': '#ffffff',
'bgcolor': '#ffffff',
'textcolor': '#000000',
'headbgcolor': '#ffffff',
'headtextcolor': '#000000',
'headlinkcolor': '#c60f0f',
'linkcolor': '#328e4a',
'visitedlinkcolor': '#63409b',
'codebgcolor': '#eeffcc',
'codetextcolor': '#333333'
}
# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
......@@ -167,7 +190,7 @@ html_static_path = ['_static']
htmlhelp_basename = 'snf-image-creatordoc'
# -- Options for LaTeX output --------------------------------------------------
# -- Options for LaTeX output -------------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
......@@ -181,7 +204,8 @@ latex_elements = {
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
# (source start file, target name, title, author, documentclass
# [howto/manual]).
latex_documents = [
('index', 'snf-image-creator.tex', u'snf-image-creator Documentation',
u'GRNET', 'manual'),
......@@ -208,20 +232,24 @@ latex_documents = [
#latex_domain_indices = True
# -- Options for manual page output --------------------------------------------
# -- Options for manual page output -------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'snf-image-creator', u'snf-image-creator Documentation',
[u'GRNET'], 1)
('man/snf-image-creator', 'snf-image-creator',
'Command line image creator for Synnefo',
'Synnefo development team <synnefo-devel@googlegroups.com>', 1),
('man/snf-mkimage', 'snf-mkimage',
'Dialog-based image creator for Synnefo',
'Synnefo development team <synnefo-devel@googlegroups.com>', 1)
]
# If true, show URL addresses after external links.
#man_show_urls = False
# -- Options for Texinfo output ------------------------------------------------
# -- Options for Texinfo output -----------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
......
......@@ -17,11 +17,19 @@ Contents:
install
usage
Contact
=======
Indices and tables
==================
For questions or bug reports you can contact the Synnefo team at the following
mailing lists:
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
* Users list: synnefo@googlegroups.com
* Developers list: synnefo-devel@googlegroups.com
..
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
Installation
^^^^^^^^^^^^
This guide describes how to install snf-image-creator on an Ubuntu 12.04 LTS
system. It it highly recommended to have virtualization capable hardware.
snf-image-creator will work on processors that do not support virtualization
but it will be extremely slow.
This guide describes how to install snf-image-creator on a Linux system. It is
highly recommended to have virtualization capable hardware. snf-image-creator
will work on processors that do not support virtualization but it will be slow.
Dependencies
============
......@@ -15,36 +14,199 @@ snf-image-creator depends on the following programs:
* Python setuptools [http://pypi.python.org/pypi/setuptools]
* Python Dialog [http://pythondialog.sourceforge.net/]
* Python bindings for libguestfs [http://libguestfs.org/]
* Kamaki [https://code.grnet.gr/projects/kamaki]
* Python interface to sendfile [http://pypi.python.org/pypi/pysendfile]
* pyparted [https://fedorahosted.org/pyparted/]
* rsync [http://rsync.samba.org/]
* ./kamaki [https://code.grnet.gr/projects/kamaki]
* Python sh (previously pbs) [https://github.com/amoffat/sh]
* ANSI colors for Python [http://pypi.python.org/pypi/ansicolors]
* progress [http://pypi.python.org/pypi/progress]
The above dependencies are resolved differently, depending on the installation
method you choose. There are two installation methods available:
#. `Installation using packages <#install-snf-image-creator-using-packages>`_
#. `Installation from source <#install-snf-image-creator-from-source>`_
Install snf-image-creator using packages
========================================
Ubuntu
------
For *Ubuntu 12.04 LTS* and *12.10* systems, you can use our official packages
found in *grnet/synnefo* Lauchpad PPA.
Add the synnefo PPA in your system:
.. code-block:: console
$ sudo apt-add-repository ppa:grnet/synnefo
$ sudo apt-get update
If *apt-add-repository* is missing, first install:
*software-properties-common* (Ubuntu 12.10):
.. code-block:: console
$ sudo apt-get install software-properties-common
Or *python-software-properties* (Ubuntu 12.04):
.. code-block:: console
$ sudo apt-get install python-software-properties
After the synnefo repository is set up, you should be able to list
snf-image-creator by calling:
.. code-block:: console
$ apt-cache showpkg snf-image-creator
Install the package by issuing:
.. code-block:: console
$ sudo apt-get install snf-image-creator
.. note::
If you are asked during the installation to create/update a
"supermin appliance", choose "Yes".
.. warning::
In *Ubuntu 12.10* the current package of libguestfs (1.18-2) is broken. Take
a look at the open `bug report <https://bugs.launchpad.net/ubuntu/quantal/+source/libguestfs/+bug/1086974>`_.
Until version 1.18-2ubunut1 is out, you may workaround this problem by
creating a symlink like this:
*sudo ln -s /usr/lib/guestfs /usr/lib/x86_64-linux-gnu/guestfs*
Fedora
------
For *Fedora 17* you can use our official packages hosted at the *synnefo*
repository of the openSUSE Build Service.
Add the *synnefo* repository for *Fedora 17* to *yum*:
.. code-block:: console
$ cd /etc/yum.repos.d
$ wget http://download.opensuse.org/repositories/home:/GRNET:/synnefo/Fedora_17/home:GRNET:synnefo.repo
To list the *snf-image-creator* package use the following command:
.. code-block:: console
$ yum info snf-image-creator
Install the package by issuing:
.. code-block:: console
$ yum install snf-image-creator
CentOS
------
For *CentOS 6* you can use our official packages hosted at the *synnefo*
repository of the openSUSE Build Service.
Add the *synnefo* repository for *CentOS 6* to the yum repositories list:
.. code-block:: console
$ cd /etc/yum.repos.d
$ wget http://download.opensuse.org/repositories/home:/GRNET:/synnefo/CentOS_CentOS-6/home:GRNET:synnefo.repo
Check the `Fedora <#fedora>`_ instructions on how to install the software.
Arch Linux
----------
For *Arch Linux* there are **unofficial** packages in AUR:
https://aur.archlinux.org/packages/snf-image-creator/ kindly provided by
Axilleas Pipinellis <axilleas@archlinux.info>.
.. note::
Those packages are not maintained by the Synnefo development team.
Please direct package-specific questions to Axilleas Pipinellis <axilleas@archlinux.info>,
Cc: the Synnefo development team <synnefo-devel@googlegroups.com>
To install the package you may use *yaourt*. Create and install
the *yaourt* package:
.. code-block:: console
$ wget https://aur.archlinux.org/packages/pa/package-query/package-query.tar.gz
$ tar -xvf package-query.tar.gz
$ cd package-query
$ makepkg -s
$ pacman -U package-query-<VERSION>-<ARCH>.pkg.tar.xz
$ cd ..
$ wget https://aur.archlinux.org/packages/ya/yaourt/yaourt.tar.gz
$ tar -xvf yaourt.tar.gz
$ cd yaourt
$ makepkg -s
$ pacman -U yaourt-<VERSION>-<ARCH>.pkg.tar.xz
Install *snf-image-creator* using yaourt:
.. code-block:: console
$ yaourt -Sa snf-image-creator
Install snf-image-creator from source
=====================================
Manually install the following dependencies:
* Python 2 [http://www.python.org/]
* Python setuptools [http://pypi.python.org/pypi/setuptools]
* Python Dialog [http://pythondialog.sourceforge.net/]
* Python bindings for libguestfs [http://libguestfs.org/]
* Python interface to sendfile [http://pypi.python.org/pypi/pysendfile]
* pyparted [https://fedorahosted.org/pyparted/]
* rsync [http://rsync.samba.org/]
In Ubuntu you can do this using:
.. code-block:: console
The first four programs (python2, setuptools, libguestfs and Python Dialog)
need to be installed manually by the user. In an Ubuntu 12.04 LTS system this
can be archived by installing packages provided by the distribution, using the
following command:
$ sudo apt-get install python-setuptools python-guestfs python-dialog \
python-sendfile python-parted rsync
If you are using Ubuntu 12.10 you also need to install libguestfs-tools:
.. code-block:: console
$ apt-get install python-setuptools python-guestfs python-dialog
$ sudo apt-get install libguestfs-tools
The rest of the dependencies will be automatically resolved by setuptools.
.. note::
If you are asked during the installation to create/update a
"supermin appliance", choose "Yes".
Python Virtual Environment
==========================
--------------------------
Since snf-image-creator and the rest of it's dependencies won't be installed
Since snf-image-creator and the rest of its dependencies won't be installed
using packages, it's better to work in an isolated python virtual environment
(virtualenv). Installing the Virtual Python Environment builder in Ubuntu can
be accomplished using the following command:
(virtualenv).
Install the Virtual Python Environment builder:
http://pypi.python.org/pypi/virtualenv.
For Ubuntu use the following command:
.. code-block:: console
$ apt-get install python-virtualenv
$ sudo apt-get install python-virtualenv
Now, create a new python virtual environment like this:
Then create a new python virtual environment:
.. code-block:: console
......@@ -56,45 +218,50 @@ and activate it by executing:
$ source ~/image-creator-env/bin/activate
You can later deactivate it using the following command:
You may later deactivate it using:
.. code-block:: console
$ deactivate
kamaki Installation
===================
Install kamaki from source, by cloning it's repository:
-------------------
.. code-block:: console
Refer to `./kamaki documentation <http://docs.dev.grnet.gr/kamaki/latest/installation.html>`_
for instructions. You may install kamaki from source inside the virtualenv
you've created above or by using binary packages if they are available for your
distribution.
$ git clone https://code.grnet.gr/git/kamaki
$ cd kamaki
$ ./setup build
snf-image-creator Installation
------------------------------
Then, make sure you are within the activated virtual environment before you
execute:
Download the latest snf-image-creator source package from
`here <https://code.grnet.gr/projects/snf-image-creator/files>`_ and install it
inside the virtualenv using the following commands:
.. code-block:: console
$ ./setup install
$ tar -xf snf_image_creator-<VERSION>.tar.gz
$ cd snf_image_creator-<VERSION>
$ python ./setup.py install
snf-image-creator Installation
==============================
Install snf-image-creator the same way:
Alternatively, you can install the bleeding edge version of the software by
cloning its git repository:
.. code-block:: console
$ git clone https://code.grnet.gr/git/snf-image-creator
$ cd snf-image-creator
$ ./setup build
$ python ./setup.py install
And from within the virtual environment execute:
To do the latter, you'll need to have git (http://git-scm.com/) installed.
For ubuntu this can be done using:
.. code-block:: console
$ ./setup install
$ sudo apt-get install git
.. warning::
Keep in mind that the bleeding edge version may be unstable or even
unusable.
:orphan:
snf-image-creator manual page
=============================
Synopsis
--------
**snf-image-creator** [OPTION] <INPUT MEDIA>
Description
-----------
Create image out of an <INPUT MEDIA>. The <INPUT MEDIA> may be a block device,
a regular file that represents a hard disk or \`/' to bundle the host system
itself.
Options
-------
--disable-sysprep=SYSPREP
prevent SYSPREP operation from running on the input media
--enable-sysprep=SYSPREP
run SYSPREP operation on the input media
-f, --force
overwrite output files if they exist
-h, --help
show this help message and exit
-m KEY=VALUE, --metadata=KEY=VALUE
add custom KEY=VALUE metadata to the image
--no-shrink
don't shrink any partition
--no-sysprep
don't perform any system preparation operation
-o FILE, --outfile=FILE
dump image to FILE
--public
register image with cyclades as public
--print-sysprep
print the enabled and disabled system preparation operations for this
input media
-r IMAGENAME, --register=IMAGENAME
register the image with cyclades as IMAGENAME
-s, --silent
output only errors
-t TOKEN, --token=TOKEN
use this token when uploading/registering images to a Synnefo
deployment
--tmpdir=DIR