"Failed to take a backup of . Check if exists. /opt/vmware/appliance/bin/create-backup.sh: line 101: [: -ne: unary operator expected"
Version 10.3 of VMware Cloud Director implements a new method of managing certificates.
pem
and .key
file for the HTTP and ConsoleProxy endpoints, each with a unique path.create-backup.sh
script references these paths, so if the files did not properly convert, the backup script will error out.To resolve this issue, the HTTP and ConsoleProxy certificates must be re-imported into each cell in the VCD environment.
For versions 10.3 and later, this requires a .pem
file and a .key
file.
pem
file is effectively the certificate, and the .key
file is the associated key.If you have your own private key and CA-signed certificate files, importing them into your VMware Cloud Director environment provides the highest level of trust for SSL communications and helps you secure the connections within your cloud infrastructure.
Prerequisites
Copy your intermediate certificates, root CA certificate, CA-signed HTTPS service, and Console Proxy service private keys and certificates to the appliance.
Procedure
cp path_to_the_user.http.pem /opt/vmware/vcloud-director/etc/user.http.pem.original
cp path_to_the_user.http.key /opt/vmware/vcloud-director/etc/user.http.key.original
cp path_to_the_user.consoleproxy.pem /opt/vmware/vcloud-director/etc/user.consoleproxy.pem.original
cp path_to_the_user.consoleproxy.key /opt/vmware/vcloud-director/etc/user.consoleproxy.key.original
cat intermediate-certificate-file-1.cer intermediate-certificate-file-2.cer root-CA-certificate.cer >> /opt/vmware/vcloud-director/etc/user.http.pem
cat intermediate-certificate-file-1.cer intermediate-certificate-file-2.cer root-CA-certificate.cer >> /opt/vmware/vcloud-director/etc/user.consoleproxy.pem
Where intermediate-certificate-file-1.cer and intermediate-certificate-file-2.cer are the names of intermediate certificates and root-CA-certificate.cer is the name of the root CA-signed certificate.
/opt/vmware/vcloud-director/bin/cell-management-tool certificates -j --cert /opt/vmware/vcloud-director/etc/user.http.pem --key /opt/vmware/vcloud-director/etc/user.http.key --key-password imported_key_password
/opt/vmware/vcloud-director/bin/cell-management-tool certificates -p --cert /opt/vmware/vcloud-director/etc/user.consoleproxy.pem --key /opt/vmware/vcloud-director/etc/user.consoleproxy.key --key-password imported_key_password
/opt/vmware/vcloud-director/bin/cell-management-tool cell -i $(service vmware-vcd pid cell) -s
systemctl start vmware-vcd
Workaround:
To workaround this issue, take a backup of the database using the built-in postgres
utilities, as shown below:
su postgres
/opt/vmware/vpostgres/current/bin/pg_dump vcloud > dbdump.out