Merge "Adds another validation step when using dynamic allocation"
This commit is contained in:
commit
d8b04680d4
@ -8,7 +8,7 @@ proliantutils>=2.1.11
|
|||||||
pyghmi>=0.8.0
|
pyghmi>=0.8.0
|
||||||
pysnmp
|
pysnmp
|
||||||
python-ironic-inspector-client>=1.5.0
|
python-ironic-inspector-client>=1.5.0
|
||||||
python-oneviewclient<3.0.0,>=2.5.1
|
python-oneviewclient<3.0.0,>=2.5.2
|
||||||
python-scciclient>=0.4.0
|
python-scciclient>=0.4.0
|
||||||
python-seamicroclient>=0.4.0
|
python-seamicroclient>=0.4.0
|
||||||
UcsSdk==0.8.2.2
|
UcsSdk==0.8.2.2
|
||||||
|
@ -26,6 +26,7 @@ from ironic.drivers import utils
|
|||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
client = importutils.try_import('oneview_client.client')
|
client = importutils.try_import('oneview_client.client')
|
||||||
|
oneview_utils = importutils.try_import('oneview_client.utils')
|
||||||
oneview_states = importutils.try_import('oneview_client.states')
|
oneview_states = importutils.try_import('oneview_client.states')
|
||||||
oneview_exceptions = importutils.try_import('oneview_client.exceptions')
|
oneview_exceptions = importutils.try_import('oneview_client.exceptions')
|
||||||
|
|
||||||
@ -166,6 +167,10 @@ def validate_oneview_resources_compatibility(oneview_client, task):
|
|||||||
oneview_info = get_oneview_info(task.node)
|
oneview_info = get_oneview_info(task.node)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
spt_uuid = oneview_utils.get_uuid_from_uri(
|
||||||
|
oneview_info.get("server_profile_template_uri")
|
||||||
|
)
|
||||||
|
|
||||||
oneview_client.validate_node_server_profile_template(oneview_info)
|
oneview_client.validate_node_server_profile_template(oneview_info)
|
||||||
oneview_client.validate_node_server_hardware_type(oneview_info)
|
oneview_client.validate_node_server_hardware_type(oneview_info)
|
||||||
oneview_client.validate_node_enclosure_group(oneview_info)
|
oneview_client.validate_node_enclosure_group(oneview_info)
|
||||||
@ -176,11 +181,15 @@ def validate_oneview_resources_compatibility(oneview_client, task):
|
|||||||
)
|
)
|
||||||
|
|
||||||
# NOTE(thiagop): Support to pre-allocation will be dropped in the Pike
|
# NOTE(thiagop): Support to pre-allocation will be dropped in the Pike
|
||||||
# release
|
# release.
|
||||||
|
# NOTE(mrtenio): The Server Profile Template needs to have a physical
|
||||||
|
# MAC when using dynamic_allocation. This will be the default behavior
|
||||||
|
# in the Pike Release.
|
||||||
if is_dynamic_allocation_enabled(task.node):
|
if is_dynamic_allocation_enabled(task.node):
|
||||||
oneview_client.is_node_port_mac_compatible_with_server_hardware(
|
oneview_client.is_node_port_mac_compatible_with_server_hardware(
|
||||||
oneview_info, node_ports
|
oneview_info, node_ports
|
||||||
)
|
)
|
||||||
|
oneview_client.validate_server_profile_template_mac_type(spt_uuid)
|
||||||
else:
|
else:
|
||||||
oneview_client.check_server_profile_is_applied(oneview_info)
|
oneview_client.check_server_profile_is_applied(oneview_info)
|
||||||
oneview_client.is_node_port_mac_compatible_with_server_profile(
|
oneview_client.is_node_port_mac_compatible_with_server_profile(
|
||||||
|
@ -238,6 +238,8 @@ class OneViewCommonTestCase(db_base.DbTestCase):
|
|||||||
with task_manager.acquire(self.context, self.node.uuid) as task:
|
with task_manager.acquire(self.context, self.node.uuid) as task:
|
||||||
common.validate_oneview_resources_compatibility(oneview_client,
|
common.validate_oneview_resources_compatibility(oneview_client,
|
||||||
task)
|
task)
|
||||||
|
self.assertTrue(
|
||||||
|
oneview_client.validate_node_server_hardware.called)
|
||||||
self.assertTrue(
|
self.assertTrue(
|
||||||
oneview_client.validate_node_server_hardware_type.called)
|
oneview_client.validate_node_server_hardware_type.called)
|
||||||
self.assertTrue(
|
self.assertTrue(
|
||||||
@ -254,6 +256,9 @@ class OneViewCommonTestCase(db_base.DbTestCase):
|
|||||||
is_node_port_mac_compatible_with_server_hardware.called)
|
is_node_port_mac_compatible_with_server_hardware.called)
|
||||||
self.assertFalse(
|
self.assertFalse(
|
||||||
oneview_client.validate_spt_primary_boot_connection.called)
|
oneview_client.validate_spt_primary_boot_connection.called)
|
||||||
|
self.assertFalse(
|
||||||
|
oneview_client.
|
||||||
|
validate_server_profile_template_mac_type.called)
|
||||||
|
|
||||||
@mock.patch.object(common, 'get_oneview_client', spec_set=True,
|
@mock.patch.object(common, 'get_oneview_client', spec_set=True,
|
||||||
autospec=True)
|
autospec=True)
|
||||||
@ -263,14 +268,15 @@ class OneViewCommonTestCase(db_base.DbTestCase):
|
|||||||
"""Validate compatibility of resources for Dynamic Allocation model.
|
"""Validate compatibility of resources for Dynamic Allocation model.
|
||||||
|
|
||||||
1) Set 'dynamic_allocation' flag as True on node's driver_info
|
1) Set 'dynamic_allocation' flag as True on node's driver_info
|
||||||
2) Check validate_node_server_hardware_type method is called
|
2) Check validate_node_server_profile_template method is called
|
||||||
3) Check validate_node_enclosure_group method is called
|
3) Check validate_node_server_hardware_type method is called
|
||||||
4) Check validate_node_server_profile_template method is called
|
4) Check validate_node_enclosure_group method is called
|
||||||
5) Check is_node_port_mac_compatible_with_server_hardware method
|
5) Check validate_node_server_hardware method is called
|
||||||
|
6) Check is_node_port_mac_compatible_with_server_hardware method
|
||||||
is called
|
is called
|
||||||
6) Check validate_node_server_profile_template method is called
|
7) Check validate_server_profile_template_mac_type method is called
|
||||||
7) Check check_server_profile_is_applied method is not called
|
8) Check check_server_profile_is_applied method is not called
|
||||||
8) Check is_node_port_mac_compatible_with_server_profile method is
|
9) Check is_node_port_mac_compatible_with_server_profile method is
|
||||||
not called
|
not called
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@ -282,17 +288,20 @@ class OneViewCommonTestCase(db_base.DbTestCase):
|
|||||||
|
|
||||||
common.validate_oneview_resources_compatibility(oneview_client,
|
common.validate_oneview_resources_compatibility(oneview_client,
|
||||||
task)
|
task)
|
||||||
|
self.assertTrue(
|
||||||
|
oneview_client.validate_node_server_profile_template.called)
|
||||||
self.assertTrue(
|
self.assertTrue(
|
||||||
oneview_client.validate_node_server_hardware_type.called)
|
oneview_client.validate_node_server_hardware_type.called)
|
||||||
self.assertTrue(
|
self.assertTrue(
|
||||||
oneview_client.validate_node_enclosure_group.called)
|
oneview_client.validate_node_enclosure_group.called)
|
||||||
self.assertTrue(
|
self.assertTrue(
|
||||||
oneview_client.validate_node_server_profile_template.called)
|
oneview_client.validate_node_server_hardware.called)
|
||||||
self.assertTrue(
|
self.assertTrue(
|
||||||
oneview_client.
|
oneview_client.
|
||||||
is_node_port_mac_compatible_with_server_hardware.called)
|
is_node_port_mac_compatible_with_server_hardware.called)
|
||||||
self.assertTrue(
|
self.assertTrue(
|
||||||
oneview_client.validate_node_server_profile_template.called)
|
oneview_client.
|
||||||
|
validate_server_profile_template_mac_type.called)
|
||||||
self.assertFalse(
|
self.assertFalse(
|
||||||
oneview_client.check_server_profile_is_applied.called)
|
oneview_client.check_server_profile_is_applied.called)
|
||||||
self.assertFalse(
|
self.assertFalse(
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
upgrade:
|
||||||
|
- Minimum required version of python-oneviewclient bumped to 2.5.2
|
||||||
|
fixes:
|
||||||
|
- A validation step is added to verify that the Server Profile
|
||||||
|
Template's MAC type is set to Physical when dynamic allocation
|
||||||
|
is enabled. The OneView Driver needs this verification
|
||||||
|
because the machine is going to use a MAC that will only be
|
||||||
|
specified at the profile application.
|
Loading…
x
Reference in New Issue
Block a user