Add 'NoCloud' cloud-init datasource

- Install cloud-init
- Add only 'NoCloud' datasource to cloud-init, to perform some
  actions automatically after first start of a node. See [1] [2]
- Allow predictable interface naming for debian and ubuntu images
- Enable ACPI for VMs created with fuel-devops templates to match
  interface names with predictable interface naming scheme.

[1] http://cloudinit.readthedocs.io/en/latest/topics/datasources.html#no-cloud
[2] https://github.com/openstack/fuel-ccp-tests/blob/master/fuel_ccp_tests/templates/cloudinit-user-data.yaml

Change-Id: Ic4dd6d82ff305b8182974727f8acec6a959749ea
This commit is contained in:
Dennis Dmitriev 2016-09-27 12:00:50 +03:00
parent 71265d4891
commit 716ea04dd9
11 changed files with 25 additions and 19 deletions

View File

@ -9,29 +9,29 @@ rack-01-node-params:
source_image:
format: qcow2
interfaces:
- label: eth0
- label: ens3
l2_network_device: public
interface_model: virtio
- label: eth1
- label: ens4
l2_network_device: private
interface_model: virtio
- label: eth2
- label: ens5
l2_network_device: storage
interface_model: virtio
- label: eth3
- label: ens6
l2_network_device: management
interface_model: virtio
network_config:
eth0:
ens3:
networks:
- public
eth1:
ens4:
networks:
- private
eth2:
ens5:
networks:
- storage
eth3:
ens6:
networks:
- management
@ -73,6 +73,7 @@ groups:
stp: True
hpet: False
use_host_cpu: true
enable_acpi: True
network_pools: # Address pools for OpenStack networks.
# Actual names should be used for keys

View File

@ -43,6 +43,7 @@ template:
stp: False
hpet: False
use_host_cpu: !os_env DRIVER_USE_HOST_CPU, true
enable_acpi: True
network_pools: # Address pools for OpenStack networks.
# Actual names should be used for keys

View File

@ -39,6 +39,7 @@ template:
stp: False
hpet: False
use_host_cpu: !os_env DRIVER_USE_HOST_CPU, true
enable_acpi: True
network_pools: # Address pools for OpenStack networks.
# Actual names should be used for keys

View File

@ -47,6 +47,7 @@ template:
stp: False
hpet: False
use_host_cpu: !os_env DRIVER_USE_HOST_CPU, true
enable_acpi: True
network_pools: # Address pools for OpenStack networks.
private: private-pool01

View File

@ -41,6 +41,7 @@ template:
stp: False
hpet: False
use_host_cpu: !os_env DRIVER_USE_HOST_CPU, true
enable_acpi: True
network_pools: # Address pools for OpenStack networks.
public: public-pool01

View File

@ -67,7 +67,6 @@
"console-keymaps-at/keymap=us ",
"domain=localhost ",
"hostname=localhost ",
"net.ifnames=0 ",
"<enter><wait>"
]
},
@ -113,7 +112,6 @@
"console-keymaps-at/keymap=us ",
"domain=localhost ",
"hostname=localhost ",
"net.ifnames=0 ",
"<enter><wait>"
]
}
@ -138,7 +136,8 @@
"scripts/debian/setup.sh",
"scripts/vagrant.sh",
"scripts/sshd.sh",
"scripts/vmtool.sh"
"scripts/vmtool.sh",
"scripts/cloud-init.sh"
]
},
{

View File

@ -382,7 +382,7 @@ d-i grub-installer/bootdev string default
# Use the following option to add additional boot parameters for the
# installed system (if supported by the bootloader installer).
# Note: options passed to the installer will be added automatically.
d-i debian-installer/add-kernel-opts string net.ifnames=0
#d-i debian-installer/add-kernel-opts string net.ifnames=0
### Finishing up the installation
# During installations from serial console, the regular virtual consoles

View File

@ -5,7 +5,6 @@ d-i debian-installer/country string US
d-i debian-installer/locale string en_US.UTF-8
d-i keyboard-configuration/xkb-keymap select us
d-i base-installer/kernel/override-image string linux-server
d-i debian-installer/add-kernel-opts string net.ifnames=0 biosdevname=0
d-i clock-setup/utc-auto boolean true
d-i clock-setup/utc boolean true
d-i debconf/frontend select noninteractive
@ -34,3 +33,4 @@ d-i time/zone string UTC
d-i user-setup/allow-password-weak boolean true
d-i user-setup/encrypt-home boolean false
tasksel tasksel/first multiselect standard, ubuntu-server
cloud-init cloud-init/datasources multiselect NoCloud, None

View File

@ -0,0 +1,5 @@
#!/bin/bash -eux
### Install packages
echo "==> Installing cloud-init"
apt-get install -y cloud-init cloud-guest-utils cloud-initramfs-growroot cloud-initramfs-copymods

View File

@ -3,7 +3,7 @@
echo "==> Configuring serial console"
cat >> /etc/default/grub <<EOF
GRUB_TERMINAL=serial
GRUB_CMDLINE_LINUX='0 console=ttyS0,19200n8 cgroup_enable=memory swapaccount=1 net.ifnames=0 biosdevname=0'
GRUB_CMDLINE_LINUX='0 console=ttyS0,19200n8 cgroup_enable=memory swapaccount=1'
GRUB_SERIAL_COMMAND="serial --speed=19200 --unit=0 --word=8 --parity=no --stop=1"
EOF

View File

@ -69,8 +69,6 @@
"domain=ubuntu1604 ",
"console-setup/ask_detect=false ",
"keyboard-configuration/layoutcode=us ",
"net.ifnames=0 ",
"biosdevname=0 ",
"vga=788 noprompt quiet --<enter>"
]
},
@ -120,8 +118,6 @@
"domain=ubuntu1604 ",
"console-setup/ask_detect=false ",
"keyboard-configuration/layoutcode=us ",
"net.ifnames=0 ",
"biosdevname=0 ",
"vga=788 noprompt quiet --<enter>"
]
}
@ -145,7 +141,8 @@
"scripts/debian/setup.sh",
"scripts/vagrant.sh",
"scripts/sshd.sh",
"scripts/vmtool.sh"
"scripts/vmtool.sh",
"scripts/cloud-init.sh"
]
},
{