Riferimenti

Tecnologie

LXC

Configuratione

File /etc/salt/cloud.providers.d/myconfig.conf.org

kimsufi-lxc:
  target: virtualization.kimsufi.ovh
  provider: lxc
#  driver: lxc    # since 2015.8

File /etc/salt/cloud.profiles.d/myprofile.conf:

kimsufi-base-lxc:
  provider: kimsufi-lxc
  lxc_profile:
    backing: lvm
    size: 5G
    template: download
    options:
      dist: debian
      release: jessie
      arch: amd64
  network_profile:
    eth0:
      link: lxcbr0
      type: veth
      flags: up
      ipv4: 10.0.3.5/24
      gateway: 10.0.3.1
  minion:
    master: mysalt.com

In alternativa posso inserire alcuni valori anche nel master.conf o persino nei pillars:

lxc.container_profile:
  kimsufi-base-lxc:
    size: 5G

Comandi

salt.run

salt-run cloud.query

salt

salt myminion lxc.create container1 profile=centos network_profile=centos nic_opts='{eth0: {ipv4: 10.0.0.20/24, gateway: 10.0.0.1}}'
salt virt.lxc lxc.create cancelme config=/etc/lxc/default.conf profile=debian network_profile=basic nic_opts="{'eth0': {'ipv4': '10.0.3.91'}}"

salt salt cloud.create kimsufi-lxc myfirstsalttest profile=kimsufi-lxc

salt salt lxc.init myfirstsalttest profile=kimsufi-lxc host=testlxc

salt virtualization.kimsufi.ovh cloud.query

salt virtualization.kimsufi.ovh lxc.list
salt virtualization.kimsufi.ovh lxc.destroy test

salt virt.kimsufi.lxc lxc.create cancelme profile=debian network_profile=basic config=/etc/lxc/default.conf nic_opts="{'eth0': {'ipv4': '10.0.3.91'}}" vgname=kimsufi
salt virt.kimsufi.lxc lxc.start cancelme
salt virt.kimsufi.lxc lxc.bootstrap cancelme

salt-cloud

salt-cloud --list-locations kimsufi-lxc
salt-cloud --list-images kimsufi-lxc
salt-cloud --list-sizes kimsufi-lxc
salt-cloud --query
salt-cloud -p kimsufi-base-lxc testdaelim
salt-cloud -d testdaelim
salt-cloud -m map.test

KVM

Per creare immagini:

MyWiki: Salt/Cloud (last edited 2016-05-07 17:29:41 by risca)