Adding ability to manualy configure network inside VM before boot.
This patchset obsoletes switching from "dhcp" to "static" during
deployment.
Example pillars:
salt:
control:
enabled: true
virt_enabled: true
size:
small:
cpu: 1
ram: 1
cluster:
infra:
domain: example.com
engine: virt
config:
engine: salt
host: master.domain.com
cloud_init:
network_data:
links:
- id: ens2
name: ens2
type: phy
user_data:
disable_ec2_metadata: true
resize_rootfs: True
timezone: UTC
ssh_deletekeys: True
ssh_genkeytypes: ['rsa', 'dsa', 'ecdsa']
ssh_svcname: ssh
locale: en_US.UTF-8
disable_root: true
apt_preserve_sources_list: false
apt:
sources_list: ""
sources:
ubuntu.list:
source: ${linux:system:repo:ubuntu:source}
mcp_saltstack.list:
source: ${linux:system:repo:mcp_saltstack:source}
node:
ctl01:
provider: kvm01.example.com
image: ubuntu-16.04.qcow2
size: small
cloud_init:
network_data:
networks:
- id: private-ipv4
ip_address: 192.168.0.161
link: ens2
netmask: 255.255.255.0
routes:
- gateway: 192.168.0.1
netmask: 0.0.0.0
network: 0.0.0.0
type: ipv4
Change-Id: I087518404c61e0bab2303e40957bacca94692102
diff --git a/tests/pillar/control_virt_custom.sls b/tests/pillar/control_virt_custom.sls
index 71cf37f..061d47d 100644
--- a/tests/pillar/control_virt_custom.sls
+++ b/tests/pillar/control_virt_custom.sls
@@ -1,3 +1,13 @@
+_param:
+ private-ipv4: &private-ipv4
+ - id: private-ipv4
+ type: ipv4
+ link: ens2
+ netmask: 255.255.255.0
+ routes:
+ - gateway: 192.168.0.1
+ netmask: 0.0.0.0
+ network: 0.0.0.0
virt:
disk:
three_disks:
@@ -57,6 +67,29 @@
config:
engine: salt
host: master.domain.com
+ cloud_init:
+ user_data:
+ disable_ec2_metadata: true
+ resize_rootfs: True
+ timezone: UTC
+ ssh_deletekeys: True
+ ssh_genkeytypes: ['rsa', 'dsa', 'ecdsa']
+ ssh_svcname: ssh
+ locale: en_US.UTF-8
+ disable_root: true
+ apt_preserve_sources_list: false
+ apt:
+ sources_list: ""
+ sources:
+ ubuntu.list:
+ source: ${linux:system:repo:ubuntu:source}
+ mcp_saltstack.list:
+ source: ${linux:system:repo:mcp_saltstack:source}
+ network_data:
+ links:
+ - id: ens2
+ type: phy
+ name: ens2
node:
ubuntu1:
provider: node01.domain.com
@@ -72,6 +105,11 @@
provider: node03.domain.com
image: meowbuntu.qcom2
size: medium_three_disks
+ cloud_init:
+ network_data:
+ networks:
+ - <<: *private-ipv4
+ ip_address: 192.168.0.161
rng:
backend: /dev/urandom
model: random