Implement parallel node provisioning
This commit is contained in:
parent
125b2686cb
commit
76fa8a629d
@ -13,9 +13,7 @@ from solar.events.api import add_event
|
|||||||
|
|
||||||
discovery_service = 'http://0.0.0.0:8881'
|
discovery_service = 'http://0.0.0.0:8881'
|
||||||
|
|
||||||
# DEBUG use a single node
|
nodes_list = requests.get(discovery_service).json()
|
||||||
nodes_list = [requests.get(discovery_service).json()[0]]
|
|
||||||
|
|
||||||
|
|
||||||
# Create slave node resources
|
# Create slave node resources
|
||||||
node_resources = vr.create('nodes', 'templates/not_provisioned_nodes.yaml', {'nodes': nodes_list})
|
node_resources = vr.create('nodes', 'templates/not_provisioned_nodes.yaml', {'nodes': nodes_list})
|
||||||
|
@ -4,6 +4,10 @@ set -eux
|
|||||||
|
|
||||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
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
|
solar resource clear_all
|
||||||
python "${DIR}"/provision.py
|
python "${DIR}"/provision.py
|
||||||
|
|
||||||
@ -11,4 +15,3 @@ solar changes stage
|
|||||||
solar changes process
|
solar changes process
|
||||||
solar orch run-once last
|
solar orch run-once last
|
||||||
watch --color -n1 'solar orch report last'
|
watch --color -n1 'solar orch report last'
|
||||||
|
|
||||||
|
@ -3,4 +3,15 @@
|
|||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- lineinfile: create=yes dest=/etc/dnsmasq.d/no_pxe_{{exclude_mac_pxe | replace(':', '_')}}.conf line="dhcp-host={{exclude_mac_pxe}},set:nopxe"
|
- 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
|
- shell: service dnsmasq restart
|
||||||
|
@ -4,3 +4,5 @@ set -eux
|
|||||||
|
|
||||||
# Fake run action which is required in order to make
|
# Fake run action which is required in order to make
|
||||||
# dependency `run` -> `provision`
|
# dependency `run` -> `provision`
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user