"openstack undercloud backup" creates empty files

Bug #1812960 reported by Juan Badia Payno
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Medium
Toure Dunnon

Bug Description

The file undercloud backup file downloaded from swift contains two empty files (the DBs and the filesystem):

To reproduce:

1.- Install the undercloud (Ensure apply patch https://review.openstack.org/#/c/632438/ otherwise you got stuck later)

2.- Do the undercloud backup, execute: "openstack undercloud backup"

3.- Download the backup to a temporary directory
  mkdir tmp
  cd tmp
  swift list
      __cache__
      overcloud
      overcloud-messages
      tripleo-validations
      undercloud-backups
      undercloud-backups_segments
  swift download undercloud-backups

4.- Check the backup files
  (undercloud) [stack@undercloud tmp]$ ls
  UC-backup-20190123065744.tar
  (undercloud) [stack@undercloud tmp]$ tar xvf UC-backup-20190123065744.tar
  ./
  ./all-databases-20190123065744.sql.gz
  ./filesystem-20190123065744.tar

  (undercloud) [stack@undercloud tmp]$ ls -lhrt
  total 36K
  -rw-r--r--. 1 stack stack 10K Jan 23 06:57 filesystem-20190123065744.tar
  -rw-r--r--. 1 stack stack 20 Jan 23 06:57 all-databases-20190123065744.sql.gz
  -rw-rw-r--. 1 stack stack 20K Jan 23 06:57 UC-backup-20190123065744.tar

  (undercloud) [stack@undercloud tmp]$ gzip -d all-databases-20190123065744.sql.gz
  (undercloud) [stack@undercloud tmp]$ ls -la
  total 36
  drwx------. 2 stack stack 119 Jan 23 07:13 .
  drwx------. 10 stack stack 4096 Jan 23 07:11 ..
  -rw-r--r--. 1 stack stack 0 Jan 23 06:57 all-databases-20190123065744.sql
  -rw-r--r--. 1 stack stack 10240 Jan 23 06:57 filesystem-20190123065744.tar
  -rw-rw-r--. 1 stack stack 20480 Jan 23 06:57 UC-backup-20190123065744.tar
  (undercloud) [stack@undercloud tmp]$ tar xvf filesystem-20190123065744.tar
  (undercloud) [stack@undercloud tmp]$ tar -tvf filesystem-20190123065744.tar

Revision history for this message
Juan Badia Payno (jbadiapa) wrote :

The CreateDatabaseBackup depends on the mysqldump command which is not installed on the mistral_executor container.

https://github.com/openstack/tripleo-common/blob/master/tripleo_common/actions/undercloud.py#L83

The CreateFileSystemBackup depends on "sudo" and the visibility of the filesystem. The container has none of them.

https://github.com/openstack/tripleo-common/blob/master/tripleo_common/actions/undercloud.py#L136

(undercloud) [stack@undercloud ~]$ sudo podman exec -it mistral_executor /bin/bash
()[mistral@undercloud /]$ ls -l /home/
total 0
drwx------. 2 validations validations 62 Jan 21 15:17 validations
()[mistral@undercloud /]$ sudo tar cvfz /var/tmp/test.tgz /home/

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

[sudo] password for mistral:

Martin Mágr (mmagr)
Changed in tripleo:
assignee: nobody → Martin Mágr (mmagr)
Martin Mágr (mmagr)
Changed in tripleo:
milestone: none → stein-3
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (master)

Fix proposed to branch: master
Review: https://review.openstack.org/640038

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-common (master)

Fix proposed to branch: master
Review: https://review.openstack.org/640344

Changed in tripleo:
milestone: stein-3 → stein-rc1
Changed in tripleo:
importance: Undecided → Medium
milestone: stein-rc1 → train-1
Changed in tripleo:
milestone: train-1 → train-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.opendev.org/665707

Changed in tripleo:
assignee: Martin Mágr (mmagr) → Toure Dunnon (toure)
Changed in tripleo:
milestone: train-2 → train-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (master)

Reviewed: https://review.opendev.org/640038
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=70d41af00a1d4489d37ad0659748a4ff8ce5ed1f
Submitter: Zuul
Branch: master

commit 70d41af00a1d4489d37ad0659748a4ff8ce5ed1f
Author: Martin Magr <email address hidden>
Date: Thu Feb 28 15:12:01 2019 +0100

    Enable mistral_executor to perform backups

    Moving undercloud deployment to container means that during execution
    of undercloud backup mistral-executor does not have required connections
    and data available and so creates empty tarball currently. This patch is
    one of many, which are supposed to fix this. On THT side we need to:

    - Include DB host IP address in tripleo.undercloud-config env
      - we need to have this information about undercloud IP available
        as we cannot connect to local socket anymore and using 'localhost'
        does not work.

    - Mount directories which are meant to be backed up
      - currently directories backing up directories local to mistral_executor
        are useless for undercloud backup

    Change-Id: Ia1fd60a13570a42f5243beb5bb0487c743e31d27
    Partial-Bug: #1812960

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-common (master)

Reviewed: https://review.opendev.org/640344
Committed: https://git.openstack.org/cgit/openstack/tripleo-common/commit/?id=f7cc16c2359cf740c93eb153dc02e0f7aa6f0579
Submitter: Zuul
Branch: master

commit f7cc16c2359cf740c93eb153dc02e0f7aa6f0579
Author: Martin Magr <email address hidden>
Date: Fri Mar 1 12:43:00 2019 +0100

    Fix undercloud backup via tripleoclient

    The move to containerized deployment introduced a regression that mistral
    executor service does not have access to undercloud host any more because
    it runs in container. This patch and it's dependencies are fixing this
    issue by:

      - using remote connection during DB backup
      - using volume mounts during filesystem backup

    For details see following patches.

    Change-Id: I8726187da444b55832bc2741da66ab7240e7bc3e
    Depends-On: Ia1fd60a13570a42f5243beb5bb0487c743e31d27
    Depends-On: I67899db3c1f4197210bc362a8f944529a3a7b2b3
    Closes-Bug: #1812960

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on tripleo-common (master)

Change abandoned by Martin Mágr (<email address hidden>) on branch: master
Review: https://review.opendev.org/665707

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-common 11.2.0

This issue was fixed in the openstack/tripleo-common 11.2.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.