Don't set boot_option=local on baremetal flavors
Setting boot_option_local is no longer required as its the default. So setting this is redundant. Migrate existing flavors to remove boot_option if set to local. Change-Id: Ib793acc98641091bcde2580b725656976e5d6625 Depends-On: I9fbe12f7878328f0ca084e29483f30d18dad1773 Related-Bug: #1803965
This commit is contained in:
parent
f190d35e52
commit
3d9e7731b5
|
@ -63,19 +63,23 @@ def _configure_nova(sdk):
|
||||||
extra_specs = {'resources:CUSTOM_BAREMETAL': 1,
|
extra_specs = {'resources:CUSTOM_BAREMETAL': 1,
|
||||||
'resources:VCPU': 0,
|
'resources:VCPU': 0,
|
||||||
'resources:MEMORY_MB': 0,
|
'resources:MEMORY_MB': 0,
|
||||||
'resources:DISK_GB': 0,
|
'resources:DISK_GB': 0}
|
||||||
'capabilities:boot_option': 'local'}
|
|
||||||
profiles = ['control', 'compute', 'ceph-storage', 'block-storage',
|
profiles = ['control', 'compute', 'ceph-storage', 'block-storage',
|
||||||
'swift-storage']
|
'swift-storage', 'baremetal']
|
||||||
flavors = [flavor.name for flavor in sdk.list_flavors()]
|
flavors = [flavor.name for flavor in sdk.list_flavors()]
|
||||||
if 'baremetal' not in flavors:
|
|
||||||
flavor = sdk.create_flavor('baremetal', **sizings)
|
|
||||||
sdk.set_flavor_specs(flavor.id, extra_specs)
|
|
||||||
for profile in profiles:
|
for profile in profiles:
|
||||||
if profile not in flavors:
|
if profile not in flavors:
|
||||||
flavor = sdk.create_flavor(profile, **sizings)
|
flavor = sdk.create_flavor(profile, **sizings)
|
||||||
extra_specs.update({'capabilities:profile': profile})
|
if profile != 'baremetal':
|
||||||
|
extra_specs.update({'capabilities:profile': profile})
|
||||||
|
else:
|
||||||
|
extra_specs.pop('capabilities:profile', None)
|
||||||
sdk.set_flavor_specs(flavor.id, extra_specs)
|
sdk.set_flavor_specs(flavor.id, extra_specs)
|
||||||
|
else:
|
||||||
|
flavor = sdk.get_flavor(profile)
|
||||||
|
# In place to migrate flavors from rocky too stein
|
||||||
|
if flavor.extra_specs.get('capabilities:boot_option') == 'local':
|
||||||
|
sdk.unset_flavor_specs(flavor.id, ['capabilities:boot_option'])
|
||||||
print('INFO: Undercloud Post - Nova configuration completed successfully.')
|
print('INFO: Undercloud Post - Nova configuration completed successfully.')
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue