Revision b0ddf192 docs/usage.rst
b/docs/usage.rst | ||
---|---|---|
17 | 17 |
|
18 | 18 |
.. code-block:: console |
19 | 19 |
|
20 |
$ snf-image-creator --help |
|
21 |
Usage: snf-image-creator [options] <input_media> |
|
22 |
|
|
23 |
Options: |
|
24 |
--version show program's version number and exit |
|
25 |
-h, --help show this help message and exit |
|
26 |
-o FILE, --outfile=FILE |
|
27 |
dump image to FILE |
|
28 |
-f, --force overwrite output files if they exist |
|
29 |
-s, --silent output only errors |
|
30 |
-u FILENAME, --upload=FILENAME |
|
31 |
upload the image to pithos with name FILENAME |
|
32 |
-r IMAGENAME, --register=IMAGENAME |
|
33 |
register the image with ~okeanos as IMAGENAME |
|
34 |
-m KEY=VALUE, --metadata=KEY=VALUE |
|
35 |
add custom KEY=VALUE metadata to the image |
|
36 |
-t TOKEN, --token=TOKEN |
|
37 |
use this token when uploading/registering images |
|
38 |
[Default: None] |
|
39 |
--print-sysprep print the available enabled and disabled system |
|
40 |
preparation operations for this input media |
|
41 |
--enable-sysprep=SYSPREP |
|
42 |
run SYSPREP operation on the input media |
|
43 |
--disable-sysprep=SYSPREP |
|
44 |
prevent SYSPREP operation from running on the input |
|
45 |
media |
|
46 |
--no-sysprep don't perform any system preparation operation |
|
47 |
--no-shrink don't shrink the image |
|
48 |
--public register image with cyclades as public |
|
49 |
--tmpdir=DIR create large temporary image files under DIR |
|
20 |
$ snf-image-creator --help |
|
21 |
Usage: snf-image-creator [options] <input_media> |
|
22 |
|
|
23 |
Options: |
|
24 |
--version show program's version number and exit |
|
25 |
-h, --help show this help message and exit |
|
26 |
-o FILE, --outfile=FILE |
|
27 |
dump image to FILE |
|
28 |
-f, --force overwrite output files if they exist |
|
29 |
-s, --silent output only errors |
|
30 |
-u FILENAME, --upload=FILENAME |
|
31 |
upload the image to pithos with name FILENAME |
|
32 |
-r IMAGENAME, --register=IMAGENAME |
|
33 |
register the image with ~okeanos as IMAGENAME |
|
34 |
-m KEY=VALUE, --metadata=KEY=VALUE |
|
35 |
add custom KEY=VALUE metadata to the image |
|
36 |
-t TOKEN, --token=TOKEN |
|
37 |
use this authentication token when |
|
38 |
uploading/registering images |
|
39 |
-a URL, --authentication-url=URL |
|
40 |
use this authentication URL when uploading/registering |
|
41 |
images |
|
42 |
-c CLOUD, --cloud=CLOUD |
|
43 |
use this saved cloud account to authenticate against a |
|
44 |
cloud when uploading/registering images |
|
45 |
--print-sysprep print the enabled and disabled system preparation |
|
46 |
operations for this input media |
|
47 |
--enable-sysprep=SYSPREP |
|
48 |
run SYSPREP operation on the input media |
|
49 |
--disable-sysprep=SYSPREP |
|
50 |
prevent SYSPREP operation from running on the input |
|
51 |
media |
|
52 |
--no-sysprep don't perform any system preparation operation |
|
53 |
--no-shrink don't shrink any partition |
|
54 |
--public register image with cyclades as public |
|
55 |
--tmpdir=DIR create large temporary image files under DIR |
|
50 | 56 |
|
51 | 57 |
Most input options are self-describing. If you want to save a local copy of |
52 | 58 |
the image you create, provide a filename using the *-o* option. To upload the |
53 |
image to *pithos+*, provide a valid authentication token using *-t* and a |
|
59 |
image to *pithos+*, provide valid cloud API access info (by either using a |
|
60 |
token with *-t* and a URL with *-a* pair or a cloud name with *-c*) and a |
|
54 | 61 |
filename using *-u*. If you also want to register the image with *~okeanos*, in |
55 | 62 |
addition to *-u* provide a registration name using *-r*. All images are |
56 | 63 |
registered as *private*. Only the user that registers the image can create |
... | ... | |
75 | 82 |
|
76 | 83 |
.. code-block:: console |
77 | 84 |
|
78 |
$ snf-image-creator --print-sysprep debian_desktop.img |
|
79 |
|
|
80 |
snf-image-creator 0.1 |
|
85 |
$ snf-image-creator --print-sysprep ubuntu.raw |
|
86 |
snf-image-creator 0.3 |
|
81 | 87 |
===================== |
82 |
Examining source media `debian_desktop.img'... looks like an image file
|
|
83 |
Snapshotting media source... done |
|
88 |
Examining source media `ubuntu_hd.raw' ... looks like an image file
|
|
89 |
Snapshotting media source ... done
|
|
84 | 90 |
Enabling recovery proc |
85 |
Launching helper VM... done |
|
86 |
Inspecting Operating System... found a(n) debian system |
|
87 |
Mounting the media read-only... done |
|
88 |
|
|
91 |
Launching helper VM (may take a while) ... done |
|
92 |
Inspecting Operating System ... ubuntu |
|
93 |
Mounting the media read-only ... done |
|
94 |
Collecting image metadata ... done |
|
95 |
Umounting the media ... done |
|
96 |
|
|
89 | 97 |
Enabled system preparation operations: |
90 | 98 |
cleanup-cache: |
91 |
Remove all regular files under /var/cache
|
|
92 |
|
|
99 |
Remove all regular files under /var/cache
|
|
100 |
|
|
93 | 101 |
cleanup-log: |
94 |
Empty all files under /var/log
|
|
95 |
|
|
102 |
Empty all files under /var/log
|
|
103 |
|
|
96 | 104 |
cleanup-passwords: |
97 |
Remove all passwords and lock all user accounts
|
|
98 |
|
|
105 |
Remove all passwords and lock all user accounts
|
|
106 |
|
|
99 | 107 |
cleanup-tmp: |
100 |
Remove all files under /tmp and /var/tmp
|
|
101 |
|
|
108 |
Remove all files under /tmp and /var/tmp
|
|
109 |
|
|
102 | 110 |
cleanup-userdata: |
103 |
Delete sensitive userdata
|
|
104 |
|
|
111 |
Delete sensitive userdata
|
|
112 |
|
|
105 | 113 |
fix-acpid: |
106 |
Replace acpid powerdown action scripts to immediately shutdown the
|
|
107 |
system without checking if a GUI is running.
|
|
108 |
|
|
114 |
Replace acpid powerdown action scripts to immediately shutdown the
|
|
115 |
system without checking if a GUI is running.
|
|
116 |
|
|
109 | 117 |
remove-persistent-net-rules: |
110 |
Remove udev rules that will keep network interface names persistent
|
|
111 |
after hardware changes and reboots. Those rules will be created again
|
|
112 |
the next time the image runs.
|
|
113 |
|
|
118 |
Remove udev rules that will keep network interface names persistent
|
|
119 |
after hardware changes and reboots. Those rules will be created again
|
|
120 |
the next time the image runs.
|
|
121 |
|
|
114 | 122 |
remove-swap-entry: |
115 |
Remove swap entry from /etc/fstab. If swap is the last partition
|
|
116 |
then the partition will be removed when shrinking is performed. If the
|
|
117 |
swap partition is not the last partition in the disk or if you are not
|
|
118 |
going to shrink the image you should probably disable this.
|
|
119 |
|
|
123 |
Remove swap entry from /etc/fstab. If swap is the last partition
|
|
124 |
then the partition will be removed when shrinking is performed. If the
|
|
125 |
swap partition is not the last partition in the disk or if you are not
|
|
126 |
going to shrink the image you should probably disable this.
|
|
127 |
|
|
120 | 128 |
use-persistent-block-device-names: |
121 |
Scan fstab & grub configuration files and replace all non-persistent
|
|
122 |
device references with UUIDs.
|
|
123 |
|
|
129 |
Scan fstab & grub configuration files and replace all non-persistent
|
|
130 |
device references with UUIDs.
|
|
131 |
|
|
124 | 132 |
Disabled system preparation operations: |
125 | 133 |
cleanup-mail: |
126 |
Remove all files under /var/mail and /var/spool/mail
|
|
127 |
|
|
134 |
Remove all files under /var/mail and /var/spool/mail
|
|
135 |
|
|
128 | 136 |
remove-user-accounts: |
129 |
Remove all user accounts with id greater than 1000
|
|
130 |
|
|
131 |
|
|
132 |
cleaning up... |
|
137 |
Remove all user accounts with id greater than 1000
|
|
138 |
|
|
139 |
|
|
140 |
cleaning up ...
|
|
133 | 141 |
|
134 | 142 |
If you want the image to have all normal user accounts and all mail files |
135 | 143 |
removed, you should use *--enable-sysprep* option like this: |
... | ... | |
173 | 181 |
When *snf-mkimage* runs in *wizard* mode, the user is just asked to provide the |
174 | 182 |
following basic information: |
175 | 183 |
|
184 |
* Cloud: The cloud account to use to upload and register the resulting image |
|
176 | 185 |
* Name: A short name for the image (ex. "Slackware") |
177 | 186 |
* Description: An one-line description for the image |
178 | 187 |
(ex. "Slackware Linux 14.0 with KDE") |
179 | 188 |
* Registration Type: Private or Public |
180 |
* Account: The authentication token for an *~okeanos* account |
|
181 | 189 |
|
182 | 190 |
After confirming, the image will be extracted, uploaded to *pithos+* and |
183 | 191 |
registered with *~okeanos*. The user will also be given the choice to keep a |
... | ... | |
202 | 210 |
|
203 | 211 |
In the *Register* sub-menu the user can provide: |
204 | 212 |
|
205 |
* The credentials (authentication token) to use when authenticating |
|
206 |
to *~okeanos* |
|
213 |
* Which cloud account to use |
|
207 | 214 |
* A *pithos+* filename for the uploaded *diskdump* image |
208 |
* A name for the image to use when registering it with *~okeanos*, as well as
|
|
215 |
* A name for the image to use when registering it with *~cyclades*, as well as
|
|
209 | 216 |
the registration type (*private* or *public*) |
210 | 217 |
|
211 | 218 |
By choosing the *Extract* menu entry, the user can dump the image to the local |
... | ... | |
244 | 251 |
|
245 | 252 |
.. code-block:: console |
246 | 253 |
|
247 |
$ truncate -s 2G ubuntu_hd.raw
|
|
254 |
$ truncate -s 2G ubuntu.raw |
|
248 | 255 |
|
249 | 256 |
And install the Ubuntu system on this file: |
250 | 257 |
|
251 | 258 |
.. code-block:: console |
252 | 259 |
|
253 |
$ sudo kvm -boot d -drive file=ubuntu_hd.raw,format=raw,cache=none,if=virtio \
|
|
260 |
$ sudo kvm -boot d -drive file=ubuntu.raw,format=raw,cache=none,if=virtio \ |
|
254 | 261 |
-m 1G -cdrom ubuntu-12.04.2-server-amd64.iso |
255 | 262 |
|
256 | 263 |
.. warning:: |
... | ... | |
261 | 268 |
You will be able to boot your installed OS and make any changes you want |
262 | 269 |
(e.g. install openssh-server) using the following command:: |
263 | 270 |
|
264 |
$ sudo kvm -m 1G -boot c -drive file=ubuntu_hd.raw,format=raw,cache=none,if=virtio
|
|
271 |
$ sudo kvm -m 1G -boot c -drive file=ubuntu.raw,format=raw,cache=none,if=virtio |
|
265 | 272 |
|
266 | 273 |
After you're done, you may use *snf-mkimage* as root to create and upload the |
267 | 274 |
image: |
... | ... | |
269 | 276 |
.. code-block:: console |
270 | 277 |
|
271 | 278 |
$ sudo -s |
272 |
$ snf-mkimage ubuntu_hd.raw
|
|
279 |
$ snf-mkimage ubuntu.raw |
|
273 | 280 |
|
274 | 281 |
In the first screen you will be asked to choose if you want to run the program |
275 | 282 |
in *Wizard* or *Expert* mode. Choose *Wizard*. |
Also available in: Unified diff