Ensure ports aren't affected by inband cleaning

Change-Id: Ie5b7eb3afca023d43723c8a24985d379e8b05bcc
This commit is contained in:
Sam Betts 2015-12-01 15:51:38 +00:00
parent 774898ed84
commit b918a5af7a
3 changed files with 61 additions and 0 deletions

View File

@ -15,6 +15,7 @@
from ironic.drivers import agent
from cisco_ironic_contrib.ironic.cimc import boot as cimc_boot
from cisco_ironic_contrib.ironic.cimc import vendor as cimc_deploy
from cisco_ironic_contrib.ironic.cimc import vendor as cimc_vendor
@ -23,4 +24,5 @@ class AgentAndCIMCNeutronDriver(agent.AgentAndCIMCDriver):
def __init__(self):
super(AgentAndCIMCNeutronDriver, self).__init__()
self.boot = cimc_boot.PXEBoot()
self.deploy = cimc_deploy.AgentDeploy()
self.vendor = cimc_vendor.CIMCPXEVendorPassthru()

View File

@ -0,0 +1,57 @@
# Copyright 2015, Cisco Systems.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from oslo_config import cfg
from ironic.common import states
from ironic.conductor import utils as manager_utils
from ironic.drivers.modules import agent
from ironic.drivers.modules import deploy_utils
from ironic.drivers.modules import iscsi_deploy
CONF = cfg.CONF
class ISCSIDeploy(iscsi_deploy.ISCSIDeploy):
def prepare_cleaning(self, task):
deploy_utils.agent_add_clean_params(task)
ramdisk_opts = deploy_utils.build_agent_options(task.node)
ramdisk_opts.update(
iscsi_deploy.build_deploy_ramdisk_options(task.node))
task.driver.boot.prepare_ramdisk(task, ramdisk_opts)
manager_utils.node_power_action(task, states.REBOOT)
return states.CLEANWAIT
def tear_down_cleaning(self, task):
task.driver.boot.clean_up_ramdisk(task)
manager_utils.node_power_action(task, states.POWER_OFF)
class AgentDeploy(agent.AgentDeploy):
def prepare_cleaning(self, task):
deploy_utils.agent_add_clean_params(task)
if CONF.agent.manage_agent_boot:
ramdisk_opts = deploy_utils.build_agent_options(task.node)
ramdisk_opts.update(
iscsi_deploy.build_deploy_ramdisk_options(task.node))
task.driver.boot.prepare_ramdisk(task, ramdisk_opts)
manager_utils.node_power_action(task, states.REBOOT)
return states.CLEANWAIT
def tear_down_cleaning(self, task):
if CONF.agent.manage_agent_boot:
task.driver.boot.clean_up_ramdisk(task)
manager_utils.node_power_action(task, states.POWER_OFF)

View File

@ -15,6 +15,7 @@
from ironic.drivers import pxe
from cisco_ironic_contrib.ironic.cimc import boot as cimc_boot
from cisco_ironic_contrib.ironic.cimc import deploy as cimc_deploy
from cisco_ironic_contrib.ironic.cimc import vendor as cimc_vendor
@ -23,4 +24,5 @@ class PXEAndCIMCNeutronDriver(pxe.PXEAndCIMCDriver):
def __init__(self):
super(PXEAndCIMCNeutronDriver, self).__init__()
self.boot = cimc_boot.PXEBoot()
self.deploy = cimc_deploy.ISCSIDeploy()
self.vendor = cimc_vendor.CIMCPXEVendorPassthru()