From 0d058150adc4a0b19888710636397d9587c475c0 Mon Sep 17 00:00:00 2001 From: Vasyl Saienko Date: Mon, 13 Jun 2016 14:06:38 +0300 Subject: [PATCH] [Multitenancy] Add logic to work with network providers This patch adds logic to work with network providers to fuel_* ironic drivers. Depends-On: I742a52c991058d1f8bd9170f9b583c28dff22839 Change-Id: Ic3f831a9a9e5ec9031bf1a588df62c9338c47d20 Related-Bug: #1588380 --- .../ironic_fa_deploy/modules/fuel_agent.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/contrib/ironic/ironic-fa-deploy/ironic_fa_deploy/modules/fuel_agent.py b/contrib/ironic/ironic-fa-deploy/ironic_fa_deploy/modules/fuel_agent.py index a5f6084b..41154248 100644 --- a/contrib/ironic/ironic-fa-deploy/ironic_fa_deploy/modules/fuel_agent.py +++ b/contrib/ironic/ironic-fa-deploy/ironic_fa_deploy/modules/fuel_agent.py @@ -432,6 +432,7 @@ class FuelAgentDeploy(base.DeployInterface): :returns: status of the deploy. One of ironic.common.states. """ manager_utils.node_power_action(task, states.POWER_OFF) + task.driver.network.unconfigure_tenant_networks(task) return states.DELETED def prepare(self, task): @@ -440,6 +441,12 @@ class FuelAgentDeploy(base.DeployInterface): :param task: a TaskManager instance. """ node = task.node + if node.provision_state == states.DEPLOYING: + # Adding the node to provisioning network so that the dhcp + # options get added for the provisioning port. + manager_utils.node_power_action(task, states.POWER_OFF) + task.driver.network.add_provisioning_network(task) + _prepare_pxe_boot(task) node.instance_info = build_instance_info_for_deploy(task) @@ -538,7 +545,11 @@ class FuelAgentVendor(base.VendorInterface): LOG.info(_LI('Fuel Agent pass on node %s'), node.uuid) manager_utils.node_set_boot_device(task, boot_devices.DISK, persistent=True) - manager_utils.node_power_action(task, states.REBOOT) + + manager_utils.node_power_action(task, states.POWER_OFF) + task.driver.network.remove_provisioning_network(task) + task.driver.network.configure_tenant_networks(task) + manager_utils.node_power_action(task, states.POWER_ON) except Exception as e: msg = (_('Deploy failed for node %(node)s. Error: %(error)s') % {'node': node.uuid, 'error': e})