Reference Guide: Optimizing Backup Strategies for Red Hat OpenShift Virtualization

A restore failed. How do I know which compute host failed to spin up my VM?

1. Grab the restore ID:

workloadmgr snapshot-list --workload_id a0e61dc0-14eb-4e43-8c4f-ae25ac4fa8c0
workloadmgr restore-list --snapshot_id 546b542a-9fba-4484-848d-da730b4e46c6

2. In the TVM logs, get the ID of the instance that was trying to spin up:

sudo cat /var/log/workloadmgr/workloadmgr-workloads.log* | grep CopyBackupImageToVolume.execute.*ENTER | grep <restore_id> | awk '{print $9}' | cut -f1 -d"," | sort | uniq

3. Grab the host from the OpenStack DB (inside the OpenStack controller):

# Ansible
sudo lxc-attach `sudo lxc-ls -f | grep galera | awk '{print $1}'` -- mysql -u root -p`sudo cat /etc/openstack_deploy/user_secrets.yml | grep ^galera_root_password | awk '{print $NF}'` -e "select uuid,display_name,node,launched_on,created_at,deleted_at from nova.instances where uuid='a2454040-d4ed-4711-8d5e-6b3637f69aa9'\G"

# Kolla
sudo docker exec -itu root `sudo docker ps | grep mariadb | awk '{print $NF}'` mysql -u root -p`sudo cat /etc/kolla/passwords.yml | grep ^database_password | awk '{print $NF}'` -e "select uuid,display_name,node,launched_on,created_at,deleted_at from nova.instances where uuid='a2454040-d4ed-4711-8d5e-6b3637f69aa9'\G"

# RHOSP13
sudo docker exec -itu root `sudo docker ps -q -f name=galera` mysql -u root -p`sudo hiera -c /etc/puppet/hiera.yaml "mysql::server::root_password"` -e "select uuid,display_name,node,launched_on,created_at,deleted_at from nova.instances where uuid='a2454040-d4ed-4711-8d5e-6b3637f69aa9'\G"

# RHOSP16
sudo podman exec -itu root `sudo podman ps -q -f name=galera` mysql -u root -p`sudo hiera -c /etc/puppet/hiera.yaml "mysql::server::root_password"` -e "select uuid,display_name,node,launched_on,created_at,deleted_at from nova.instances where uuid='a2454040-d4ed-4711-8d5e-6b3637f69aa9'\G"

# Canonical
MYSQLPWD=$(juju exec --unit mysql-innodb-cluster/leader leader-get mysql.passwd)
juju exec --unit mysql-innodb-cluster/leader "mysql -uroot -p${MYSQLPWD} -e \"select uuid,display_name,node,launched_on,created_at,deleted_at from nova.instances where uuid='a2454040-d4ed-4711-8d5e-6b3637f69aa9'\"\\\G"