Ensure node is rebooted before enabling DPDK

In the PreNetworkConfig, the order of resources sent to os-collect-config
changed after introducing vhost user resource. The current order is
1. HostParametersDeployment
2. DpdkVhostGroupDeployment
3. RebootDeployment and EnableDpdkDeployment
Here the expectation is that RebootDeployment should be completed
before enabling DPDK, but since both are provided at the same time to
os-collect-config, DPDK is enabled first. The reson is RebootDepolyment
is having signal transport as NONE and EnableDpdkDeployment is moved
after reboot because of ovs2.7 change of restart vswitchd, when DPDK is
enabled. This is causing the a failure.
This patch modifies the order as below:
1. HostParametersDeployment and DpdkVhostGroupDeployment
2. RebootDeployment and RebootEnsureDeployment
3. EnableDpdkDeployment

Related-Bug: #1780014
Change-Id: I5db52d5dd833833c989532931baea8fac03f9cb7
(cherry picked from commit f9e099f218)
This commit is contained in:
Saravanan KR 2018-02-09 12:00:08 +05:30
parent af4661905b
commit 6953852295
1 changed files with 34 additions and 6 deletions

View File

@ -175,7 +175,6 @@ resources:
# before starting with DPDK initialization.
DpdkVhostGroupConfig:
type: OS::Heat::SoftwareConfig
depends_on: HostParametersDeployment
condition: is_dpdk_config_required
properties:
group: ansible
@ -193,7 +192,6 @@ resources:
DpdkVhostGroupDeployment:
type: OS::Heat::SoftwareDeployment
depends_on: HostParametersDeployment
condition: is_dpdk_config_required
properties:
name: DpdkVhostGroupDeployment
@ -207,7 +205,6 @@ resources:
RebootConfig:
type: OS::Heat::SoftwareConfig
depends_on: DpdkVhostGroupDeployment
condition: is_reboot_config_required
properties:
group: script
@ -220,7 +217,7 @@ resources:
RebootDeployment:
type: OS::Heat::SoftwareDeployment
depends_on: DpdkVhostGroupDeployment
depends_on: [HostParametersDeployment, DpdkVhostGroupDeployment]
condition: is_reboot_config_required
properties:
name: RebootDeployment
@ -233,6 +230,38 @@ resources:
- ['CREATE'] # Only do this on CREATE
signal_transport: NO_SIGNAL
# For successful RebootDeployment, the signal_transport should be NO_SIGNAL,
# which will make the resource as COMPLETE immediately. If the
# RebootDeployment is the last resource of the tree, then it will be
# synchronized, else the next resource (EnableDpdkDeployment), is also sent
# along with RebootDeployment. Because of which sometimes, EnableDpdkDeployment
# is executed before rebooting. As hugepages are not set to bootargs (waiting
# for reboot), EnableDpdkDeployment will fail. To ensure synchronization,
# a dummpy deployment RebootEnsureDeployment has been introduced to wait
# for reboot to enable DPDK.
RebootEnsureConfig:
type: OS::Heat::SoftwareConfig
condition: is_reboot_config_required
properties:
group: script
config: |
#!/bin/bash
echo "Reboot completed"
RebootEnsureDeployment:
type: OS::Heat::SoftwareDeployment
depends_on: RebootDeployment
condition: is_reboot_config_required
properties:
name: RebootEnsureDeployment
server: {get_param: server}
config: {get_resource: RebootEnsureConfig}
actions:
if:
- deployment_actions_empty
- []
- ['CREATE'] # Only do this on CREATE
# With OvS2.7 (which is default with pike), ovs-vswitchd will start dpdk
# immediately after setting dpdk-init (behaviour change from ovs2.6).
# Starting of DPDK require the huge page configuration to be enabled. So
@ -242,7 +271,6 @@ resources:
# maintained, restart of ovs is required.
EnableDpdkConfig:
type: OS::Heat::SoftwareConfig
depends_on: RebootDeployment
condition: is_dpdk_config_required
properties:
group: script
@ -299,7 +327,7 @@ resources:
EnableDpdkDeployment:
type: OS::Heat::SoftwareDeployment
condition: is_dpdk_config_required
depends_on: RebootDeployment
depends_on: RebootEnsureDeployment
properties:
name: EnableDpdkDeployment
server: {get_param: server}