#!/bin/sh

set -x
set -e

nova_manage="nova-manage --config-file /etc/nova/nova.conf"
available_commands_text=$(nova-manage --help | awk '/Command categories/ {getline; print $0}')

$nova_manage db online_data_migrations

if echo "${available_commands_text}" | grep -q -E '[{,]placement[},]'; then
  $nova_manage placement sync_aggregates
fi

#!/bin/sh

set -x
set -e

nova_manage="nova-manage --config-file /etc/nova/nova.conf"
available_commands_text=$(nova-manage --help | awk '/Command categories/ {getline; print $0}')

{{- if or .Values.placement.enabled (.Values.imageVersion | hasPrefix "rocky" | not) }}

$nova_manage db online_data_migrations
{{- end }}

if echo "${available_commands_text}" | grep -q -E '[{,]placement[},]'; then
  $nova_manage placement sync_aggregates
fi

Disable online migrations with placement
[nova] Disable online migrations with placement

If placement gets deployed by its own service,
we can't have nova mess with its tables
