65 lines
1.3 KiB
Plaintext
65 lines
1.3 KiB
Plaintext
|
|
== lxc-fancy ==
|
|
|
|
* 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
|
|
|
|
Source: https://github.com/plitc/lxc-fancy
|
|
|
|
'''features''':
|
|
* 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
|
|
** lxc-container hostname anpassung
|
|
|
|
* delete
|
|
** zfs destroy clone
|
|
** lxc-container stoppen und symbolische links unter /var/lib/lxc und /lxc-container entfernen
|
|
|
|
=== usage ===
|
|
|
|
<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
|
|
Please enter the new LXC Container name:
|
|
test1
|
|
|
|
Do you wish to start this LXC Container: test1 ? (y/n) y
|
|
|
|
... starting screen session ...
|
|
21110.test1 (04/11/15 06:39:37) (Detached)
|
|
|
|
That's it
|
|
</source>
|
|
|
|
=== screen login ===
|
|
|
|
<source lang="bash">
|
|
# screen -x 21110.test1
|
|
</source>
|
|
|
|
=== delete ===
|
|
|
|
Beispiel zum löschen eines LXC Containers
|
|
|
|
<source lang="bash">
|
|
# lxc-fancy delete
|
|
Please enter the LXC Container name:
|
|
test1
|
|
|
|
... shutdown & delete the lxc container ...
|
|
|
|
That's it
|
|
</source>
|