Allow forcing nova compute_id
Developers that need to stack and re-stack non-AIO compute-only environments will want to be able to keep the compute node uuid the same across runs. This mimics the behavior of a deployment tool that pre-creates the uuids, so it matches pretty well. Default to the current behavior of create-on-start, but allow forcing it ahead of time to something specific. Change-Id: Icab0b783e2233cad9a93c04758a5bccac0832203
This commit is contained in:
12
lib/nova
12
lib/nova
@@ -58,6 +58,14 @@ NOVA_METADATA_UWSGI=$NOVA_BIN_DIR/nova-metadata-wsgi
|
|||||||
NOVA_UWSGI_CONF=$NOVA_CONF_DIR/nova-api-uwsgi.ini
|
NOVA_UWSGI_CONF=$NOVA_CONF_DIR/nova-api-uwsgi.ini
|
||||||
NOVA_METADATA_UWSGI_CONF=$NOVA_CONF_DIR/nova-metadata-uwsgi.ini
|
NOVA_METADATA_UWSGI_CONF=$NOVA_CONF_DIR/nova-metadata-uwsgi.ini
|
||||||
|
|
||||||
|
# Allow forcing the stable compute uuid to something specific. This would be
|
||||||
|
# done by deployment tools that pre-allocate the UUIDs, but it is also handy
|
||||||
|
# for developers that need to re-stack a compute-only deployment multiple
|
||||||
|
# times. Since the DB is non-local and not erased on an unstack, making it
|
||||||
|
# stay the same each time is what developers want. Set to a uuid here or
|
||||||
|
# leave it blank for default allocate-on-start behavior.
|
||||||
|
NOVA_CPU_UUID=""
|
||||||
|
|
||||||
# The total number of cells we expect. Must be greater than one and doesn't
|
# The total number of cells we expect. Must be greater than one and doesn't
|
||||||
# count cell0.
|
# count cell0.
|
||||||
NOVA_NUM_CELLS=${NOVA_NUM_CELLS:-1}
|
NOVA_NUM_CELLS=${NOVA_NUM_CELLS:-1}
|
||||||
@@ -1058,6 +1066,10 @@ function start_nova_compute {
|
|||||||
iniset $NOVA_CPU_CONF workarounds libvirt_disable_apic True
|
iniset $NOVA_CPU_CONF workarounds libvirt_disable_apic True
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "$NOVA_CPU_UUID" ]]; then
|
||||||
|
echo -n $NOVA_CPU_UUID > $NOVA_CONF_DIR/compute_id
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "$VIRT_DRIVER" = 'libvirt' ]]; then
|
if [[ "$VIRT_DRIVER" = 'libvirt' ]]; then
|
||||||
# The group **$LIBVIRT_GROUP** is added to the current user in this script.
|
# The group **$LIBVIRT_GROUP** is added to the current user in this script.
|
||||||
# ``sg`` is used in run_process to execute nova-compute as a member of the
|
# ``sg`` is used in run_process to execute nova-compute as a member of the
|
||||||
|
Reference in New Issue
Block a user