Implement parallel node provisioning

This commit is contained in:
Evgeniy L 2015-10-20 14:35:38 +03:00
parent 48fcd503b1
commit 5594be3ddd
4 changed files with 18 additions and 4 deletions

View File

@ -13,9 +13,7 @@ from solar.events.api import add_event
discovery_service = 'http://0.0.0.0:8881'
# DEBUG use a single node
nodes_list = [requests.get(discovery_service).json()[0]]
nodes_list = requests.get(discovery_service).json()
# Create slave node resources
node_resources = vr.create('nodes', 'templates/not_provisioned_nodes.yaml', {'nodes': nodes_list})

View File

@ -4,6 +4,10 @@ set -eux
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Remove generated pxe exclude files
sudo rm -f /etc/dnsmasq.d/no_pxe_*.conf
sudo service dnsmasq restart
solar resource clear_all
python "${DIR}"/provision.py
@ -11,4 +15,3 @@ solar changes stage
solar changes process
solar orch run-once last
watch --color -n1 'solar orch report last'

View File

@ -3,4 +3,15 @@
tasks:
- lineinfile: create=yes dest=/etc/dnsmasq.d/no_pxe_{{exclude_mac_pxe | replace(':', '_')}}.conf line="dhcp-host={{exclude_mac_pxe}},set:nopxe"
# FIXME: currently there is no way to specify
# policy not to run several tasks in parallel,
# so when we deploy several nodes in parallel
# it causes the problems when two tasks try
# to restart supervisor at the same time, and
# fail to do it.
- command: service dnsmasq status
register: log
until: log.stdout.find('running') > -1
retries: 5
delay: 2
- shell: service dnsmasq restart

View File

@ -4,3 +4,5 @@ set -eux
# Fake run action which is required in order to make
# dependency `run` -> `provision`
exit 0