Merge "Add SR-IOV support for members"
This commit is contained in:
commit
59154ff388
@ -149,7 +149,8 @@ MEMBER_ROWS = (
|
||||
'monitor_port',
|
||||
'monitor_address',
|
||||
'backup',
|
||||
'tags')
|
||||
'tags',
|
||||
'vnic_type')
|
||||
|
||||
MEMBER_COLUMNS = (
|
||||
'id',
|
||||
|
@ -99,6 +99,10 @@ class ShowMember(command.ShowOne):
|
||||
data = self.app.client_manager.load_balancer.member_show(
|
||||
pool_id=pool_id, member_id=member_id)
|
||||
|
||||
# Handle older API versions that did not have the vnic_type
|
||||
if not data.get('vnic_type', False):
|
||||
data['vnic_type'] = 'normal'
|
||||
|
||||
formatters = {'tags': v2_utils.format_list_flat}
|
||||
|
||||
return (rows, (utils.get_dict_properties(
|
||||
@ -192,6 +196,12 @@ class CreateMember(command.ShowOne):
|
||||
action='store_true',
|
||||
help='Wait for action to complete.',
|
||||
)
|
||||
parser.add_argument(
|
||||
'--request-sriov',
|
||||
action='store_true',
|
||||
default=None,
|
||||
help='Request that the member port be created using an SR-IOV VF.',
|
||||
)
|
||||
|
||||
_tag.add_tag_option_to_parser_for_create(
|
||||
parser, 'member')
|
||||
@ -225,6 +235,10 @@ class CreateMember(command.ShowOne):
|
||||
pool_id, data['member']['id']))
|
||||
}
|
||||
|
||||
# Handle older API versions that did not have the vnic_type
|
||||
if not data['member'].get('vnic_type', False):
|
||||
data['member']['vnic_type'] = 'normal'
|
||||
|
||||
formatters = {'tags': v2_utils.format_list_flat}
|
||||
|
||||
return (rows,
|
||||
|
@ -418,6 +418,8 @@ def get_member_attrs(client_manager, parsed_args):
|
||||
'monitor_address': ('monitor_address', str),
|
||||
'enable': ('admin_state_up', lambda x: True),
|
||||
'disable': ('admin_state_up', lambda x: False),
|
||||
'request_sriov': ('request_sriov', lambda x: True),
|
||||
'vnic_type': ('vnic_type', str),
|
||||
}
|
||||
add_tags_attr_map(attr_map)
|
||||
|
||||
|
@ -0,0 +1,6 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
Added SR-IOV support for members to the client. This adds a "vnic_type"
|
||||
field to the member output and a new option "--request-sriov" for the
|
||||
member create command.
|
Loading…
x
Reference in New Issue
Block a user