Creating a new image
====================
-Suppose you want to create a new Ubuntu server image. Download the installation
-disk from the Internet:
+Suppose your host system is a Debian Wheezy and you want to create a new Ubuntu
+server image. Download the installation disk from the Internet:
.. code-block:: console
use LVM partitions. They are not supported by snf-image-creator.
You will be able to boot your installed OS and make any changes you want
-(e.g. install openssh-server) using the following command::
+(e.g. install openssh-server) using the following command:
+
+.. code-block:: console
$ sudo kvm -m 1G -boot c -drive file=ubuntu.raw,format=raw,cache=none,if=virtio
return True
+def show_properties_help(session):
+ """Show help for image properties"""
+ d = session['dialog']
+
+ help_file = get_help_file("image_properties")
+ assert os.path.exists(help_file)
+ d.textbox(help_file, title="Image Properties", width=70, height=40)
+
+
def modify_properties(session):
"""Modify an existing image property"""
d = session['dialog']
for (key, val) in session['metadata'].items():
choices.append((str(key), str(val)))
+ if len(choices) == 0:
+ code = d.yesno(
+ "No image properties are available. "
+ "Would you like to add a new one?", width=WIDTH, help_button=1)
+ if code == d.DIALOG_OK:
+ if not add_property(session):
+ return True
+ elif code == d.DIALOG_CANCEL:
+ return True
+ elif code == d.DIALOG_HELP:
+ show_properties_help(session)
+ continue
+
(code, choice) = d.menu(
"In this menu you can edit existing image properties or add new "
"ones. Be careful! Most properties have special meaning and "
elif code == d.DIALOG_EXTRA:
add_property(session)
elif code == 'help':
- help_file = get_help_file("image_properties")
- assert os.path.exists(help_file)
- d.textbox(help_file, title="Image Properties", width=70, height=40)
+ show_properties_help(session)
def delete_properties(session):
for (key, val) in session['metadata'].items():
choices.append((key, "%s" % val, 0))
+ if len(choices) == 0:
+ d.msgbox("No available images properties to delete!",
+ width=SMALL_WIDTH)
+ return True
+
(code, to_delete) = d.checklist("Choose which properties to delete:",
choices=choices, width=WIDTH)
to_delete = map(lambda x: x.strip('"'), to_delete) # needed for OpenSUSE
-__version__ = "0.5.1"
-__version_info__ = ['0', '5', '1']
+
+__version__ = "0.5.3"
__version_vcs_info__ = {
- 'branch': 'hotfix-0.5.1',
- 'revid': 'b25b422',
- 'revno': 393}
-__version_user_info__ = "skalkoto@darkstar.admin.grnet.gr"
+ 'branch': 'hotfix-0.5.3',
+ 'revid': 'dc0ecb2',
+ 'revno': 402}
+__version_user_email__ = "skalkoto@grnet.gr"
+__version_user_name__ = "Nikos Skalkotos"