mc_cloud_vm / vm registry for compute nodes¶
-
mc_states.modules.mc_cloud_vm.
vm_default_settings
(vm, cloudSettings, imgSettings, extpillar=False, vt='lxc', extdata=None)¶ Get per VM specific settings
All the defaults defaults registry settings are redinable here + This is for the moment the only backend of corpus cloud infra. If you want to implement another backend, mimic the dictionnary for this method and also settings.
- ip
- do not set it, or use at ure own risk, prefer just to read the value. This is the main ip (private network)
- additional_ips
additionnal ips which will be wired on the main bridge (br0) which is connected to internet. Be aware that you may use manual virtual mac addresses providen by you provider (online, ovh, sys). This is a list of mappings {ip: ‘’, mac: ‘’,netmask:’‘} eg:
makina-states.cloud.lxc.vms.<target>.<name>.additionnal_ips: - {'mac': '00:16:3e:01:29:40', 'gateway': None, (default) 'link': 'br0', (default) 'netmask': '32', (default) 'ip': '22.1.4.25'}
- domains
- list of domains tied with this host (first is minion id and main domain name, it is automaticly added)
- expose/expose_limited
- expose configuration to other nodes, see mc_cloud.ext_pillar
-
mc_states.modules.mc_cloud_vm.
vt_default_settings
(cloudSettings, imgSettings, ttl=60)¶ - VM default settings:
- This may be needed to be database backended in the future. As well, we may need iterator loops inside jinja templates to not eat that much memory loading large datasets.
- makina-states.services.cloud.lxc
- The settings of lxc containers that are meaningful on the cloud controller
Lately we will focus to tie the implementation to the APPCONTAINER SPEC
- cloud defaults (makina-states.services.cloud.lxc)
- defaults settings to provision lxc containers Those are all redefinable at each container level
- Settings:
- ssh_gateway
- ssh gateway info
- ssh_gateway_port
- ssh gateway info
- ssh_gateway_user
- ssh gateway info
- ssh_gateway_key
- ssh gateway info
- ports
if hostport is omitted, it will be dynamically assigned in the avalaible port range (40000-50000 by default)
hostPortRange default to portRange if portRange found
example:
{name: redis, port: 6379, protocol: tcp, hostPort: 22} {name: redis, portRange: "63:79", protocol: tcp, hostPortRange: "22:23"}
- size
- default filesystem size for container on lvm None
- gateway
- 10.5.0.1
- master
- master to uplink the container to None
- image
- LXC template to use ‘ubuntu’
- network
- ‘10.5.0.0’
- netmask
- ‘16’
- netmask_full
- ‘255.255.0.0’
- autostart
- lxc is autostarted
- bridge
- we install via states a bridge in 10.5/16 lxcbr1) ‘lxcbr1’
- sudo
- True
- use_bridge
- True
- users
- [‘root’, ‘sysadmin’]
- ssh_username
- ‘ubuntu’
- vgname
- ‘data’
- lvname
- ‘data’
- vms
List of containers ids classified by host ids:
(Mapping of {hostid: [vmid]})
The settings are not stored here for obvious performance reasons