c3d2-wiki/Rapid-lxc-deployment.mw

65 lines
1.3 KiB
Plaintext
Raw Normal View History

== lxc-fancy ==
2015-04-11 06:48:22 +02:00
* kleines skript auf (derzeit) flatbert was ein schnelles erstellen/löschen von lxc containern erlaubt
* vom skript ausführen bis zum gestarteten container dauert es nur ca 2-3 sekunden
2015-04-11 15:50:53 +02:00
Source: https://github.com/plitc/lxc-fancy
2015-04-11 06:49:36 +02:00
'''features''':
2015-04-11 06:48:22 +02:00
* create
** zfs clone von jessie/systemd vorlagen container
** anpassung der lxc config von namen,pfaden und mac adresse
** mac address randomiziert bei 2 stellen zwischen 10-99
** lxc-container per screen session starten
2015-04-11 15:17:03 +02:00
** lxc-container hostname anpassung
2015-04-11 06:48:22 +02:00
* delete
** zfs destroy clone
** lxc-container stoppen und symbolische links unter /var/lib/lxc und /lxc-container entfernen
2015-04-11 06:57:41 +02:00
=== usage ===
2015-04-11 06:50:02 +02:00
<source lang="bash">
# lxc-fancy
usage: /usr/sbin/lxc-fancy { create | delete }
</source>
=== create ===
Beispiel zur Erstellung eines LXC Containers
<source lang="bash">
# lxc-fancy create
2015-04-11 07:14:25 +02:00
Please enter the new LXC Container name:
test1
2015-04-11 07:39:57 +02:00
Do you wish to start this LXC Container: test1 ? (y/n) y
2015-04-11 17:17:16 +02:00
... starting screen session ...
21110.test1 (04/11/15 06:39:37) (Detached)
2015-04-11 16:51:50 +02:00
That's it
2015-04-11 07:41:26 +02:00
</source>
=== screen login ===
2015-04-11 07:41:26 +02:00
<source lang="bash">
# screen -x 21110.test1
</source>
=== delete ===
Beispiel zum löschen eines LXC Containers
<source lang="bash">
2015-04-11 07:06:09 +02:00
# lxc-fancy delete
2015-04-11 07:14:25 +02:00
Please enter the LXC Container name:
test1
2015-04-11 07:44:50 +02:00
2015-04-11 08:10:04 +02:00
... shutdown & delete the lxc container ...
2015-04-11 07:44:50 +02:00
That's it
</source>