Creating database backups might fail when using Ubuntu or Debian-based Linux distributions for NFS
search cancel

Creating database backups might fail when using Ubuntu or Debian-based Linux distributions for NFS

book

Article ID: 325662

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

Symptoms:
Unable to perform VCD Backup from <VCD:5480> page , receiving the below error:
"There was error creating Backup (details) Unable to create backup: A failure occurred while creating the backup on the primary."


Environment

VMware Cloud Director 10.x

Cause

This is caused by certain Linux OS default NFS behavior leveraging "RPCMOUNTDOPTS="--manage-gids". The postgres user does not have permissions on the NFS server. Hence NFS cannot be configured appropriately to support backups creation through postgres user.

Resolution

This issue is resolved in.​Cloud Director 10.5.1.1,available at VMware Downloads

Workaround:
The following workaround is available for Cloud Director 10.0 to 10.5.x versions:

1. If the appliance has file /opt/vmware/appliance/bin/create-db-backup

  • Run the following command from appliance's secure shell as root user:

sed -i '/PG_BACK_UP() {/,/}/ { /PG_BACK_UP() {/!{ /}/!d }}; /PG_BACK_UP() {/ a\su - postgres -c "$VMWARE_POSTGRES_BIN\/pg_dump -v -Fc \$DBNAME" > \$DB_DUMP_PATH 2>> \$LOG_FILE' /opt/vmware/appliance/bin/create-db-backup

2. If the appliance has file /opt/vmware/appliance/bin/create-backup.sh
  • Run the following 2 commands from appliance's secure shell as root user:

sed -i '/DB_BACKUP() {/,/}/ { /DB_BACKUP() {/!{ /}/!d }}; /DB_BACKUP() {/ a\su - postgres -c "$VMWARE_POSTGRES_BIN\/pg_dump -v -Fc \$DBNAME" > \$DB_DUMP_PATH 2>> \$LOG_FILE' /opt/vmware/appliance/bin/create-backup.sh

sed -i '/DB_USER_BACKUP() {/,/}/ { /DB_USER_BACKUP() {/!{ /}/!d }}; /DB_USER_BACKUP() {/ a\su - postgres -c "$VMWARE_POSTGRES_BIN\/pg_dumpall --roles-only | grep -e '\''CREATE ROLE vcloud;\\|ALTER ROLE vcloud WITH'\''" > \$BACKUP_DIR\/vcloud-user.sql' /opt/vmware/appliance/bin/create-backup.sh


3. Please retry the backup creation after the change has been applied.

NOTE:

  • Shutdown of the cells are NOT required to make this change.
  • The change needs to be applied ONLY on the primary appliance.
  • After the change, restart of the nodes are NOT required.