Revert "Make migration file for 9.2 consistent with openstack.yaml"
This reverts commit e0c836ceb9
.
Change-Id: I925fc237d61fd95d5839a75810cac80bed4bb750
Closes-bug: #1656824
This commit is contained in:
parent
e0c836ceb9
commit
e6300ed452
|
@ -50,13 +50,11 @@ def upgrade():
|
|||
upgrade_node_nic_attributes()
|
||||
upgrade_node_bond_attributes()
|
||||
upgrade_tags_set()
|
||||
upgrade_networks_metadata()
|
||||
upgrade_transaction_names()
|
||||
|
||||
|
||||
def downgrade():
|
||||
downgrade_transaction_names()
|
||||
downgrade_networks_metadata()
|
||||
downgrade_tags_set()
|
||||
downgrade_node_bond_attributes()
|
||||
downgrade_node_nic_attributes()
|
||||
|
@ -173,9 +171,10 @@ SECURITY_GROUPS = {
|
|||
DEFAULT_RELEASE_NIC_ATTRIBUTES = {
|
||||
'offloading': {
|
||||
'disable': {'type': 'checkbox', 'value': False,
|
||||
'weight': 10, 'label': 'Disable Offloading'},
|
||||
'modes': {'value': {}, 'type': 'offloading_modes', 'weight': 20,
|
||||
'label': 'Offloading Modes'},
|
||||
'weight': 10, 'label': 'Disable offloading'},
|
||||
'modes': {'value': {}, 'type': 'offloading_modes',
|
||||
'description': 'Offloading modes', 'weight': 20,
|
||||
'label': 'Offloading modes'},
|
||||
'metadata': {'weight': 10, 'label': 'Offloading'}
|
||||
},
|
||||
'mtu': {
|
||||
|
@ -185,63 +184,18 @@ DEFAULT_RELEASE_NIC_ATTRIBUTES = {
|
|||
'metadata': {'weight': 20, 'label': 'MTU'}
|
||||
},
|
||||
'sriov': {
|
||||
'restrictions':
|
||||
[{'condition': "version:release < '9.0'",
|
||||
'action': 'hide'}],
|
||||
'numvfs': {'min': 1, 'type': 'number', 'value': None, 'nullable': True,
|
||||
'weight': 20, 'label': 'Custom Number of Virtual Functions',
|
||||
'restrictions': ['"nic_attributes:sriov.enabled.value == "'
|
||||
'false"']
|
||||
},
|
||||
'numvfs': {'min': 1, 'type': 'number', 'value': None,
|
||||
'nullable': True, 'weight': 20,
|
||||
'label': 'Custom Number of Virtual Functions'},
|
||||
'enabled': {'type': 'checkbox', 'value': False,
|
||||
'weight': 10, 'label': 'Enable SR-IOV',
|
||||
'description': 'Single-root I/O Virtualization (SR-IOV) '
|
||||
'is a specification that, when implemented '
|
||||
'by a physical PCIe device, enables it to '
|
||||
'appear as multiple separate PCIe devices. '
|
||||
'This enables multiple virtualized guests '
|
||||
'to share direct access to the physical '
|
||||
'device, offering improved performance '
|
||||
'over an equivalent virtual device.',
|
||||
'restrictions': [{'settings:common.libvirt_type.value != '
|
||||
'\'kvm\'': '"Only KVM hypervisor works '
|
||||
'with SR-IOV"'}]},
|
||||
'weight': 10, 'label': 'SR-IOV enabled'},
|
||||
'physnet': {'type': 'text', 'value': '', 'weight': 30,
|
||||
'label': 'Physical Network Name',
|
||||
'regex': {
|
||||
'source': '^[A-Za-z0-9 _]*[A-Za-z0-9][A-Za-z0-9 _]*$',
|
||||
'error': 'Invalid physical network name'
|
||||
},
|
||||
'restrictions': [
|
||||
'nic_attributes:sriov.enabled.value == false',
|
||||
{'condition': "nic_attributes:sriov.physnet.value "
|
||||
"!= 'physnet2'",
|
||||
'message': 'Only "physnet2" will be configured by '
|
||||
'Fuel in Neutron. Configuration of other '
|
||||
'physical networks is up to Operator or '
|
||||
'plugin. Fuel will just configure '
|
||||
'appropriate pci_passthrough_whitelist '
|
||||
'option in nova.conf for such interface '
|
||||
'and physical networks.',
|
||||
'action': 'none'
|
||||
}
|
||||
]},
|
||||
'label': 'Physical network'},
|
||||
'metadata': {'weight': 30, 'label': 'SR-IOV'}
|
||||
},
|
||||
'dpdk': {
|
||||
'restrictions':
|
||||
[{'condition': "version:release < '9.0'",
|
||||
'action': 'hide'}],
|
||||
'enabled': {'type': 'checkbox', 'value': False,
|
||||
'weight': 10, 'label': 'Enable DPDK',
|
||||
'description': 'The Data Plane Development Kit (DPDK) '
|
||||
'provides high-performance packet '
|
||||
'processing libraries and user space '
|
||||
'drivers.',
|
||||
'restrictions': [
|
||||
{'settings:common.libvirt_type.value != \'kvm\'':
|
||||
'Only KVM hypervisor works with DPDK'}
|
||||
]},
|
||||
'weight': 10, 'label': 'DPDK enabled'},
|
||||
'metadata': {'weight': 40, 'label': 'DPDK'}
|
||||
}
|
||||
}
|
||||
|
@ -259,9 +213,10 @@ DEFAULT_RELEASE_BOND_ATTRIBUTES = {
|
|||
},
|
||||
'offloading': {
|
||||
'disable': {'type': 'checkbox', 'weight': 10, 'value': False,
|
||||
'label': 'Disable Offloading'},
|
||||
'label': 'Disable offloading'},
|
||||
'modes': {'weight': 20, 'type': 'offloading_modes',
|
||||
'value': {}, 'label': 'Offloading Modes'},
|
||||
'description': 'Offloading modes', 'value': {},
|
||||
'label': 'Offloading modes'},
|
||||
'metadata': {'weight': 20, 'label': 'Offloading'}
|
||||
},
|
||||
'mtu': {
|
||||
|
@ -282,19 +237,8 @@ DEFAULT_RELEASE_BOND_ATTRIBUTES = {
|
|||
},
|
||||
'type__': {'type': 'hidden', 'value': None},
|
||||
'dpdk': {
|
||||
'restrictions':
|
||||
[{'condition': "version:release < '9.0'",
|
||||
'action': 'hide'}],
|
||||
'enabled': {'type': 'checkbox', 'value': False,
|
||||
'weight': 10, 'label': 'Enable DPDK',
|
||||
'description': 'The Data Plane Development Kit (DPDK) '
|
||||
'provides high-performance packet '
|
||||
'processing libraries and user space '
|
||||
'drivers.',
|
||||
'restrictions': [
|
||||
{'settings:common.libvirt_type.value != \'kvm\'':
|
||||
'Only KVM hypervisor works with DPDK'}
|
||||
]},
|
||||
'enabled': {'type': 'checkbox', 'weight': 10, 'value': None,
|
||||
'label': 'DPDK enabled'},
|
||||
'metadata': {'weight': 40, 'label': 'DPDK'}
|
||||
}
|
||||
}
|
||||
|
@ -302,20 +246,6 @@ DEFAULT_RELEASE_BOND_ATTRIBUTES = {
|
|||
# minimal RAM amount for OVS+DPDK in MB
|
||||
MIN_DPDK_HUGEPAGES_MEMORY = 1024
|
||||
|
||||
|
||||
NEW_BONDING_AVAILABILITY = [
|
||||
{'dpdkovs': "'experimental' in version:feature_groups and "
|
||||
"interface:pxe == false and nic_attributes:dpdk.enabled.value "
|
||||
"and not nic_attributes:sriov.enabled.value"},
|
||||
{'linux': "not nic_attributes:sriov.enabled.value"}
|
||||
]
|
||||
|
||||
OLD_BONDING_AVAILABILITY = [
|
||||
{'dpdkovs': "'experimental' in version:feature_groups and interface:pxe "
|
||||
"== false and interface:attributes.dpdk.enabled.value "
|
||||
"and not interface:attributes.sriov.enabled.value"},
|
||||
{'linux': "not interface:attributes.sriov.enabled.value"}
|
||||
]
|
||||
# version of Fuel when security group switch was added
|
||||
FUEL_SECURITY_GROUPS_VERSION = '9.0'
|
||||
|
||||
|
@ -1193,32 +1123,3 @@ def downgrade_role_tags():
|
|||
connection.execute(sa.text(q_update_role_tags_meta.format(table)),
|
||||
roles_meta=jsonutils.dumps(roles_meta),
|
||||
obj_id=obj_id)
|
||||
|
||||
|
||||
def upgrade_networks_metadata():
|
||||
update_bonding_availability(NEW_BONDING_AVAILABILITY)
|
||||
|
||||
|
||||
def downgrade_networks_metadata():
|
||||
update_bonding_availability(OLD_BONDING_AVAILABILITY)
|
||||
|
||||
|
||||
def update_bonding_availability(bonding_availability):
|
||||
connection = op.get_bind()
|
||||
select_query = sa.sql.text(
|
||||
"SELECT id, version, networks_metadata FROM releases "
|
||||
"WHERE networks_metadata IS NOT NULL")
|
||||
update_query = sa.sql.text(
|
||||
"UPDATE releases SET networks_metadata = :networks_metadata "
|
||||
"WHERE id = :id")
|
||||
for id, version, nets in connection.execute(select_query):
|
||||
if not is_feature_supported(version, FUEL_DPDK_HUGEPAGES_VERSION):
|
||||
continue
|
||||
nets = jsonutils.loads(nets)
|
||||
if 'bonding' in nets and 'availability' in nets['bonding']:
|
||||
nets['bonding']['availability'] = bonding_availability
|
||||
|
||||
connection.execute(
|
||||
update_query,
|
||||
id=id,
|
||||
networks_metadata=jsonutils.dumps(nets))
|
||||
|
|
|
@ -290,10 +290,6 @@ class TestHandlers(BaseIntegrationTest):
|
|||
self.assertEqual(
|
||||
resp_nic['attributes']['sriov'],
|
||||
{
|
||||
'restrictions': [{
|
||||
'condition': "version:release < '9.0'",
|
||||
'action': 'hide'
|
||||
}],
|
||||
'metadata': {
|
||||
'label': 'SR-IOV',
|
||||
'weight': 30
|
||||
|
@ -400,10 +396,6 @@ class TestHandlers(BaseIntegrationTest):
|
|||
self.assertEqual(
|
||||
resp_nic['attributes']['dpdk'],
|
||||
{
|
||||
'restrictions': [{
|
||||
'condition': "version:release < '9.0'",
|
||||
'action': 'hide'
|
||||
}],
|
||||
'metadata': {
|
||||
'label': 'DPDK',
|
||||
'weight': 40
|
||||
|
@ -1242,10 +1234,6 @@ class TestNICAttributesHandlers(BaseIntegrationTest):
|
|||
}
|
||||
},
|
||||
'sriov': {
|
||||
'restrictions': [{
|
||||
'condition': "version:release < '9.0'",
|
||||
'action': 'hide'
|
||||
}],
|
||||
'metadata': {
|
||||
'label': 'SR-IOV',
|
||||
'weight': 30
|
||||
|
@ -1306,10 +1294,6 @@ class TestNICAttributesHandlers(BaseIntegrationTest):
|
|||
}
|
||||
},
|
||||
'dpdk': {
|
||||
'restrictions': [{
|
||||
'condition': "version:release < '9.0'",
|
||||
'action': 'hide'
|
||||
}],
|
||||
'metadata': {
|
||||
'label': 'DPDK',
|
||||
'weight': 40
|
||||
|
|
|
@ -885,7 +885,8 @@ class TestBondAttributesDefaultsHandler(BaseIntegrationTest):
|
|||
'weight': 20,
|
||||
'type': 'offloading_modes',
|
||||
'value': {},
|
||||
'label': 'Offloading Modes'
|
||||
'label': 'Offloading Modes',
|
||||
'description': 'Offloading modes'
|
||||
}
|
||||
},
|
||||
'mtu': {
|
||||
|
@ -904,10 +905,6 @@ class TestBondAttributesDefaultsHandler(BaseIntegrationTest):
|
|||
}
|
||||
},
|
||||
'dpdk': {
|
||||
'restrictions': [{
|
||||
'condition': "version:release < '9.0'",
|
||||
'action': 'hide'
|
||||
}],
|
||||
'enabled': {
|
||||
'value': False,
|
||||
'label': 'Enable DPDK',
|
||||
|
@ -1007,4 +1004,4 @@ class TestBondAttributesDefaultsHandler(BaseIntegrationTest):
|
|||
kwargs={"node_id": self.node.id}),
|
||||
headers=self.default_headers)
|
||||
self.assertEqual(resp.status_code, 200)
|
||||
self.assertEqual(self.EXPECTED_ATTRIBUTES, resp.json_body)
|
||||
self.assertDictEqual(self.EXPECTED_ATTRIBUTES, resp.json_body)
|
||||
|
|
|
@ -2131,9 +2131,6 @@
|
|||
min: 42
|
||||
max: 65536
|
||||
sriov:
|
||||
restrictions:
|
||||
- condition: "version:release < '9.0'"
|
||||
action: "hide"
|
||||
metadata:
|
||||
label: "SR-IOV"
|
||||
weight: 30
|
||||
|
@ -2168,9 +2165,6 @@
|
|||
message: "Only \"physnet2\" will be configured by Fuel in Neutron. Configuration of other physical networks is up to Operator or plugin. Fuel will just configure appropriate pci_passthrough_whitelist option in nova.conf for such interface and physical networks."
|
||||
action: "none"
|
||||
dpdk:
|
||||
restrictions:
|
||||
- condition: "version:release < '9.0'"
|
||||
action: "hide"
|
||||
metadata:
|
||||
label: "DPDK"
|
||||
weight: 40
|
||||
|
@ -2207,6 +2201,7 @@
|
|||
modes:
|
||||
label: "Offloading Modes"
|
||||
weight: 20
|
||||
description: "Offloading modes"
|
||||
type: "offloading_modes"
|
||||
value: {}
|
||||
mtu:
|
||||
|
@ -2222,9 +2217,6 @@
|
|||
min: 42
|
||||
max: 65536
|
||||
dpdk:
|
||||
restrictions:
|
||||
- condition: "version:release < '9.0'"
|
||||
action: "hide"
|
||||
metadata:
|
||||
label: "DPDK"
|
||||
weight: 40
|
||||
|
|
|
@ -84,9 +84,10 @@ SECURITY_GROUPS = {
|
|||
DEFAULT_NIC_ATTRIBUTES = {
|
||||
'offloading': {
|
||||
'disable': {'type': 'checkbox', 'value': False,
|
||||
'weight': 10, 'label': 'Disable Offloading'},
|
||||
'modes': {'value': {}, 'type': 'offloading_modes', 'weight': 20,
|
||||
'label': 'Offloading Modes'},
|
||||
'weight': 10, 'label': 'Disable offloading'},
|
||||
'modes': {'value': {}, 'type': 'offloading_modes',
|
||||
'description': 'Offloading modes', 'weight': 20,
|
||||
'label': 'Offloading modes'},
|
||||
'metadata': {'weight': 10, 'label': 'Offloading'}
|
||||
},
|
||||
'mtu': {
|
||||
|
@ -96,63 +97,18 @@ DEFAULT_NIC_ATTRIBUTES = {
|
|||
'metadata': {'weight': 20, 'label': 'MTU'}
|
||||
},
|
||||
'sriov': {
|
||||
'restrictions':
|
||||
[{'condition': "version:release < '9.0'",
|
||||
'action': 'hide'}],
|
||||
'numvfs': {'min': 1, 'type': 'number', 'value': None, 'nullable': True,
|
||||
'weight': 20, 'label': 'Custom Number of Virtual Functions',
|
||||
'restrictions': ['"nic_attributes:sriov.enabled.value == "'
|
||||
'false"']
|
||||
},
|
||||
'numvfs': {'min': 1, 'type': 'number', 'nullable': True,
|
||||
'value': None, 'weight': 20,
|
||||
'label': 'Custom Number of Virtual Functions'},
|
||||
'enabled': {'type': 'checkbox', 'value': False,
|
||||
'weight': 10, 'label': 'Enable SR-IOV',
|
||||
'description': 'Single-root I/O Virtualization (SR-IOV) '
|
||||
'is a specification that, when implemented '
|
||||
'by a physical PCIe device, enables it to '
|
||||
'appear as multiple separate PCIe devices. '
|
||||
'This enables multiple virtualized guests '
|
||||
'to share direct access to the physical '
|
||||
'device, offering improved performance '
|
||||
'over an equivalent virtual device.',
|
||||
'restrictions': [{'settings:common.libvirt_type.value != '
|
||||
'\'kvm\'': '"Only KVM hypervisor works '
|
||||
'with SR-IOV"'}]},
|
||||
'weight': 10, 'label': 'SR-IOV enabled'},
|
||||
'physnet': {'type': 'text', 'value': '', 'weight': 30,
|
||||
'label': 'Physical Network Name',
|
||||
'regex': {
|
||||
'source': '^[A-Za-z0-9 _]*[A-Za-z0-9][A-Za-z0-9 _]*$',
|
||||
'error': 'Invalid physical network name'
|
||||
},
|
||||
'restrictions': [
|
||||
'nic_attributes:sriov.enabled.value == false',
|
||||
{'condition': "nic_attributes:sriov.physnet.value "
|
||||
"!= 'physnet2'",
|
||||
'message': 'Only "physnet2" will be configured by '
|
||||
'Fuel in Neutron. Configuration of other '
|
||||
'physical networks is up to Operator or '
|
||||
'plugin. Fuel will just configure '
|
||||
'appropriate pci_passthrough_whitelist '
|
||||
'option in nova.conf for such interface '
|
||||
'and physical networks.',
|
||||
'action': 'none'
|
||||
}
|
||||
]},
|
||||
'label': 'Physical network'},
|
||||
'metadata': {'weight': 30, 'label': 'SR-IOV'}
|
||||
},
|
||||
'dpdk': {
|
||||
'restrictions':
|
||||
[{'condition': "version:release < '9.0'",
|
||||
'action': 'hide'}],
|
||||
'enabled': {'type': 'checkbox', 'value': False,
|
||||
'weight': 10, 'label': 'Enable DPDK',
|
||||
'description': 'The Data Plane Development Kit (DPDK) '
|
||||
'provides high-performance packet '
|
||||
'processing libraries and user space '
|
||||
'drivers.',
|
||||
'restrictions': [
|
||||
{'settings:common.libvirt_type.value != \'kvm\'':
|
||||
'Only KVM hypervisor works with DPDK'}
|
||||
]},
|
||||
'weight': 10, 'label': 'DPDK enabled'},
|
||||
'metadata': {'weight': 40, 'label': 'DPDK'}
|
||||
}
|
||||
}
|
||||
|
@ -170,9 +126,10 @@ DEFAULT_BOND_ATTRIBUTES = {
|
|||
},
|
||||
'offloading': {
|
||||
'disable': {'type': 'checkbox', 'weight': 10, 'value': False,
|
||||
'label': 'Disable Offloading'},
|
||||
'label': 'Disable offloading'},
|
||||
'modes': {'weight': 20, 'type': 'offloading_modes',
|
||||
'value': {}, 'label': 'Offloading Modes'},
|
||||
'description': 'Offloading modes', 'value': {},
|
||||
'label': 'Offloading modes'},
|
||||
'metadata': {'weight': 20, 'label': 'Offloading'}
|
||||
},
|
||||
'mtu': {
|
||||
|
@ -193,19 +150,8 @@ DEFAULT_BOND_ATTRIBUTES = {
|
|||
},
|
||||
'type__': {'type': 'hidden', 'value': None},
|
||||
'dpdk': {
|
||||
'restrictions':
|
||||
[{'condition': "version:release < '9.0'",
|
||||
'action': 'hide'}],
|
||||
'enabled': {'type': 'checkbox', 'value': False,
|
||||
'weight': 10, 'label': 'Enable DPDK',
|
||||
'description': 'The Data Plane Development Kit (DPDK) '
|
||||
'provides high-performance packet '
|
||||
'processing libraries and user space '
|
||||
'drivers.',
|
||||
'restrictions': [
|
||||
{'settings:common.libvirt_type.value != \'kvm\'':
|
||||
'Only KVM hypervisor works with DPDK'}
|
||||
]},
|
||||
'enabled': {'type': 'checkbox', 'weight': 10, 'value': None,
|
||||
'label': 'DPDK enabled'},
|
||||
'metadata': {'weight': 40, 'label': 'DPDK'}
|
||||
}
|
||||
}
|
||||
|
@ -835,10 +781,10 @@ class TestNodeNICAndBondAttributesMigration(base.BaseAlembicMigrationTest):
|
|||
sa.select([releases_table.c.nic_attributes,
|
||||
releases_table.c.bond_attributes])
|
||||
).fetchone()
|
||||
self.assertItemsEqual(DEFAULT_NIC_ATTRIBUTES,
|
||||
jsonutils.loads(result['nic_attributes']))
|
||||
self.assertItemsEqual(DEFAULT_BOND_ATTRIBUTES,
|
||||
jsonutils.loads(result['bond_attributes']))
|
||||
self.assertEqual(DEFAULT_NIC_ATTRIBUTES,
|
||||
jsonutils.loads(result['nic_attributes']))
|
||||
self.assertEqual(DEFAULT_BOND_ATTRIBUTES,
|
||||
jsonutils.loads(result['bond_attributes']))
|
||||
|
||||
def test_upgrade_node_nic_attributes_with_empty_properties(self):
|
||||
interfaces_table = self.meta.tables['node_nic_interfaces']
|
||||
|
@ -931,8 +877,8 @@ class TestNodeNICAndBondAttributesMigration(base.BaseAlembicMigrationTest):
|
|||
|
||||
expected_attributes = copy.deepcopy(DEFAULT_BOND_ATTRIBUTES)
|
||||
expected_attributes['mode']['value']['value'] = 'active-backup'
|
||||
self.assertItemsEqual(jsonutils.loads(result['attributes']),
|
||||
expected_attributes)
|
||||
self.assertEqual(jsonutils.loads(result['attributes']),
|
||||
expected_attributes)
|
||||
|
||||
def test_upgrade_node_bond_attributes(self):
|
||||
bonds_table = self.meta.tables['node_bond_interfaces']
|
||||
|
@ -952,8 +898,8 @@ class TestNodeNICAndBondAttributesMigration(base.BaseAlembicMigrationTest):
|
|||
expected_attributes['offloading']['modes']['value'] = {
|
||||
'tx-checksumming': False, 'tx-checksum-sctp': True,
|
||||
'rx-checksumming': None, 'rx-vlan-offload': False}
|
||||
self.assertItemsEqual(jsonutils.loads(result['attributes']),
|
||||
expected_attributes)
|
||||
self.assertEqual(jsonutils.loads(result['attributes']),
|
||||
expected_attributes)
|
||||
# TODO(apopovych): uncomment after removing redundant data
|
||||
# self.assertNotIn('offloading_modes', bonds_table.c)
|
||||
# self.assertNotIn('interface_properties', bonds_table.c)
|
||||
|
|
Loading…
Reference in New Issue