This blog post vCloud Director Migrations: Linux vCD to vCD Appliance – Part 3 is the third and final part of my blog post series about vCloud Director migrations.
In the first part, I migrated a Linux vCD with an external SQL Server DB to a Linux vCD with an embedded PostgresSQL DB. I migrated from a Linux vCD with external SQL DB directly to vCD Appliance in the second part.
In this vCloud Director Migrations: Linux vCD to vCD Appliance – Part 3, I will migrate the same Linux vCD with embedded PostgresSQL DB (migrated in the first part) directly to a vCloud Director Appliance. Even though it seems simple(after we know how to do it), migrating from a PostgresSQL DB in a Linux vCD to a vCD Appliance (that also has a PostgresSQL DB) is not just a DB backup a restore.
This is the source environment:
- Linux CentOs 7
- vCloud Director 10.2.2
- 2 vNIC with 2 IPs
- IP1: 192.168.1.112/24 – Used for HTTP and Console Access
- IP2: 192.168.1.113/24 – Used for DB
- 2 vNIC with 2 IPs
- vCenter / vSphere 6.7
- NSX-V 6.4.8
Destination source environment(after upgrade and migration):
- vCloud Director 10.x Appliance
- 2 vNIC with 2 IPs
- IP1: 192.168.1.110/24 – Used for HTTP and Console Access
- IP2: 192.168.2.110/24 – Used for DB
- 2 vNIC with 2 IPs
- vCenter / vSphere 6.7
- NSX-V 6.4.8
As I stated before, I will not go through the deployment of a new vCloud Director Appliance since there are already many articles about deploying a vCD Appliance. So I will only focus this blog post on the migration between Linux vCD and the vCD Appliance.
I will assume that you already have fully deployed your new vCloud Director Appliance to where you need to migrate your Linux vCloud Director. Before I start, I will check my vCD to check if I have the same version and build.
As we can see above, there is a difference in the version/builds. Since I am using a previous vCD Appliance that I installed before, the build is older, and also time zone is different.
In this last article about vCloud Migrations, I show quick steps on how to upgrade both Linux vCloud Director and vCloud Appliance.
My first task here is to upgrade both to the latest vCD 10.2 build and fix the time zone for both vCD. Downloaded the latest vCD version build 10.2.2
Note: Don’t forget to first create a backup, or a VM snapshot of your vCD, before starting the upgrade.
Start vCloud Director Upgrade Process.
Note: As I did in previous articles in this series so that it is easy to identify the steps and area to do those steps/commands, I will refer to Source Linux vCD(vCD with PostgresSQL DB) and Destination vCD Appliance (as the new vCD Appliance that you did install)
1. Upload the file to each vCD, stop vCD and run the upgrade.
1 2 3 4 |
root@vCD [ /tmp/vmware ]# /opt/vmware/vcloud-director/bin/cell-management-tool -u administrator cell –s root@vCD [ /tmp/vmware ]# service vmware-vcd stop |
In Source Linux vCD.
1 2 3 4 |
root@Linux-vCD [ /tmp/vmware ]# chmod u+x vmware-vcloud-director-distribution-10.2.2-17855679.bin root@Linux-vCD[ /tmp/vmware ]# ./vmware-vcloud-director-distribution-10.2.2-17855679.bin |
In Destination vCD Appliance.
1 2 3 4 5 6 7 8 9 10 |
root@Destination-vCD-Appliance [ /tmp ]# mkdir /tmp/local-update-package root@Destination-vCD-Appliance [ /tmp ]# tar -zxf VMware_Cloud_Director_10.2.2.5821-17855679_update.tar.gz -C /tmp/local-update-package root@Destination-vCD-Appliance [ /tmp ]# vamicli update --repo file:///tmp/local-update-package Set local repository address... Done. root@Destination-vCD-Appliance[ /tmp ]# vamicli update --check Checking for available updates, this process can take a few minutes... Available Updates - 10.2.2.5821 Build 17855679 root@Destination-vCD-Appliance [ /tmp ]# vamicli update --install latest Installing version - 10.2.2.5821 Build 17855679 ................................. |
Note: After you upgrade vCD Appliance ssh access could be disable. Login to vCD VM console and run: /opt/vmware/appliance/bin/enable_root_login.sh to enable back ssh access.
2. Then upgrade DB.
1 2 3 |
root@vCD [ /tmp/vmware ]# /opt/vmware/vcloud-director/bin/upgrade |
3. Now import all your NSX certificates after upgrading your vCloud Director to 10.x(in this case, only in the Linux vCD, since vCD Appliance is a new installation and has no resources).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
[root@Linux-vCD ~]# /opt/vmware/vcloud-director/bin/cell-management-tool trust-infra-certs --vsphere --unattended Downloading certificates for 2 host(s): 192.168.1.109 [Download: SUCCESS] 192.168.1.51 [Download: SUCCESS] Downloaded certificates for 2/2 host(s). Trusting certificates for 2 host(s): 192.168.1.51 [Trusted: SUCCESS] 192.168.1.109 [Trusted: SUCCESS] Trusted 2/2 downloaded certificates. [root@Linux-vCD ~]# |
4. Next, login Linux vCloud Director and Service Provider Admin Portal UI vCenter Server and NSX instance, and reenter the credentials while accepting the certificate.
Since I only have an NSX-V in this Linux vCD and no NSX-T, I do not need to reconnect the NSX. Reconnecting vCenter will take care of the NSX-V connection and certificates also.
Note: Since the new vCD Appliance is empty no need to do this in the new vCloud Appliance. But you can run it if you have already added a vCenter to it.
5. Changed time zone in the Appliance.
So that all configurations are set properly, I reboot both vCD login and check if all is ok. Both vCDs have the same version/build, and the time zone is time to start the migration.
Start Migration process.
Important Note: This is migration from a Linux vCloud Director with embedded PostgreSQL to a vCloud Director Appliance with an embedded PostgreSQL. In that case, the migration DB tool cannot be used here since that tool is only for external DB to an embedded PostgreSQL.
This type of migration needs to be done manually.
On Destination vCD Appliance
1. In the Destination vCD Appliance, create folders to backup files.
1 2 3 4 |
[root@Destination-vCD-Appliance [ / ]# mkdir /DestinationCerts [root@Destination-vCD-Appliance [ / ]# mkdir /SourceCerts |
2. Copy your original files from the Destination vCD Appliance
1 2 3 4 5 6 7 8 9 |
[root@Destination-vCD-Appliance [ / ]# cp /opt/vmware/vcloud-director/etc/global.properties /DestinationCerts [root@Destination-vCD-Appliance [ / ]# cp /opt/vmware/vcloud-director/etc/responses.properties /DestinationCerts [root@Destination-vCD-Appliance [ / ]# cp /opt/vmware/vcloud-director/etc/truststore* /DestinationCerts [root@Destination-vCD-Appliance [ / ]# cp /opt/vmware/vcloud-director/etc/certificates* /DestinationCerts [root@Destination-vCD-Appliance [ / ]# cp /opt/vmware/vcloud-director/etc/proxycertificates* /DestinationCerts [root@Destination-vCD-Appliance [ / ]# cp /opt/vmware/vcloud-director/certificates.ks /DestinationCerts |
On Source Linux vCD
Note: This next step is only needed if you are using Custom CA Signed Certificates on your source vCD. If you are using self-signed certificates, you can skip this step.
3. Create a folder on the Linux Source and copy file certificates.ks to it.
Note. Normalyy certificates.ks should by in the folder /opt/vmware/vcloud-director/ but in Linux CD it could be in /opt/vmware/vcloud-director/jre/bin/ that his case.
1 2 3 4 |
[root@Linux-vCD /]# mkdir CertBackup [root@Linux-vCD /]# cp ./opt/vmware/vcloud-director/jre/bin/certificates.ks /CertBackup |
4. Copy your original files from the Linux Source to Destination vCD Appliance
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
[root@Linux-vCD /]# scp /opt/vmware/vcloud-director/etc/certificates* /opt/vmware/vcloud-director/etc/proxycertificates* /opt/vmware/vcloud-director/etc/global.properties /opt/vmware/vcloud-director/etc/responses.properties /opt/vmware/vcloud-director/etc/truststore* root@192.168.1.110:/SourceCerts The authenticity of host '192.168.1.110 (192.168.1.110)' can't be established. ECDSA key fingerprint is SHA256:vZlfeik4gKqiNL+0vrqS+kFkpQkyBQ1oT4aU5RLChs4. ECDSA key fingerprint is MD5:f3:83:5e:13:d4:00:50:60:0c:f3:85:8a:01:e5:72:d7. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.1.110' (ECDSA) to the list of known hosts. Welcome to VMware Cloud Director VA root@192.168.1.110's password: certificates.bak 100% 2229 128.7KB/s 00:00 certificates.key 100% 1907 2.2MB/s 00:00 certificates.pem 100% 1272 1.5MB/s 00:00 proxycertificates.bak 100% 2238 219.9KB/s 00:00 proxycertificates.key 100% 1907 2.4MB/s 00:00 proxycertificates.pem 100% 1272 870.8KB/s 00:00 global.properties 100% 1526 1.7MB/s 00:00 responses.properties 100% 438 664.9KB/s 00:00 truststore.bak 100% 959 43.2KB/s 00:00 truststore.pem [root@Linux-vCD /]# |
5. Shutdown all vApps/VMs in vCD and stop both vCD(Source and Destination).
1 2 3 |
root@vCD-Director10 [ / ]#/opt/vmware/vcloud-director/bin/cell-management-tool -u administrator cell –s |
On Source Linux vCD
6. Copy the file certificates.ks from the Linux Source to Destination Source (make sure your NFS Share folder is mounted).
1 2 3 4 5 6 |
[root@Linux-vCD /]# scp /CertBackup/certificates.ks root@192.168.1.110:/opt/vmware/vcloud-director/data/transfer Welcome to VMware Cloud Director VA root@192.168.1.110's password: certificates.ks |
7. Create a backup of vCD PostgreSQL DB and copy it to Destination vCD Appliance.
Note: Be aware of the DB size. Depending on the size of your DB, you may need to copy to another folder/Filesystem instead of /tmp folder. Now copy and send your PostgreSQL dump file to the new vCD Appliance.
1 2 3 |
[root@Linux-vCD /]# sudo -u postgres /usr/pgsql-10/bin/pg_dump -Fc vcloud > /tmp/vCloud_DB_dump<br />[root@Linux-vCD /]# scp /tmp/vCloud_DB_dump root@192.168.1.110:/tmp/<br />Welcome to VMware Cloud Director VA<br />root@192.168.1.110's password:<br />vCloud_DB_dump 100% 13MB 53.2MB/s 00:00<br />[root@Linux-vCD /]# |
On Destination vCD Appliance
8. Now login to the Destination vCD Appliance.
- Change the permissions on the dump file.
- Drop the existing vcloud DB from the initial vCD Appliance Deployment.
- Restore the vCD PostgreSQL DB backup created in the previous step.
1 2 3 4 5 6 7 |
root@Destination-vCD-Appliance [ / ]# chmod a+r /tmp/vCloud_DB_dump root@Destination-vCD-Appliance [ / ]# sudo -i -u postgres /opt/vmware/vpostgres/current/bin/psql -c 'DROP DATABASE vcloud;' DROP DATABASE root@Destination-vCD-Appliance [ / ]# root@Destination-vCD-Appliance [ / ]# sudo -u postgres /opt/vmware/vpostgres/current/bin/pg_restore -C -d postgres /tmp/vCloud_DB_dump |
9. Now replace the original configuration files on Destination vCD Appliance with the files copy from Source Linux CD to /SourceCerts .
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
root@Destination-vCD-Appliance [ / ]# cd SourceCerts/ root@Destination-vCD-Appliance [ /SourceCerts ]# ls -la total 48 drwx------ 2 root root 4096 May 22 16:40 . drwxr-xr-x 19 root root 4096 May 1 19:40 .. -rw------- 1 root root 2229 May 22 16:40 certificates.bak -rw------- 1 root root 1907 May 22 16:40 certificates.key -rw------- 1 root root 1272 May 22 16:40 certificates.pem -rw------- 1 root root 1526 May 22 16:40 global.properties -rw------- 1 root root 2238 May 22 16:40 proxycertificates.bak -rw------- 1 root root 1907 May 22 16:40 proxycertificates.key -rw------- 1 root root 1272 May 22 16:40 proxycertificates.pem -rw------- 1 root root 438 May 22 16:40 responses.properties -rw------- 1 root root 959 May 22 16:40 truststore.bak -rw------- 1 root root 1272 May 22 16:40 truststore.pem root@Destination-vCD-Appliance [ /SourceCerts ]# root@Destination-vCD-Appliance [ /SourceCerts ]# cp *.properties /opt/vmware/vcloud-director/etc/ root@Destination-vCD-Appliance [ /SourceCerts ]# cp truststore* /opt/vmware/vcloud-director/etc/ root@Destination-vCD-Appliance [ /SourceCerts ]# cp certificates* /opt/vmware/vcloud-director/etc/ root@Destination-vCD-Appliance [ /SourceCerts ]# cp proxycertificates* /opt/vmware/vcloud-director/etc/ |
After the copy, double-check files on the destination folder and check if all are own by vcloud:vcloud and date/time (to make sure files were copied and replaced)
1 2 3 |
[root@Destination-vCD-Appliance [ /SourceCerts ]# ls -la /opt/vmware/vcloud-director/etc/ |
Note: This next step is only needed if you are using Custom CA Signed Certificates on your source vCD. If you are using self-signed certificates you can skip this step.
10. Copy certificates.ks copied in steps 3 and 6.
1 2 3 |
root@Destination-vCD-Appliance [ / ]# cp /opt/vmware/vcloud-director/data/transfer/certificates.ks /opt/vmware/vcloud-director/ |
11. Next, run the configuration cell command.
1 2 3 4 5 6 7 8 9 10 |
root@Destination-vCD-Appliance [ / ]#/opt/vmware/vcloud-director/bin/configure --unattended-installation --database-type postgres --database-user vcloud \ >--database-password 'Manager.2010' --database-host 192.168.2.110 --database-port 5432 \ >--database-name vcloud --database-ssl true --uuid --keystore /opt/vmware/vcloud-director/certificates.ks \ >--keystore-password 'Manager.2010' --primary-ip 192.168.1.110 \ >--console-proxy-ip 192.168.1.110 --console-proxy-port-https 8443 .......\ Database configuration complete. root@Destination-vCD-Appliance [ / ]# |
12. Finally, import Certificates from vCenter and NSX-V or NSX-T to the new vCloud Director.
1 2 3 4 5 6 7 8 9 10 11 12 |
root@Destination-vCD-Appliance [ /DestinationCerts ]# /opt/vmware/vcloud-director/bin/cell-management-tool trust-infra-certs --vsphere --unattended Downloading certificates for 2 host(s): 192.168.1.109 [Download: SUCCESS] 192.168.1.51 [Download: SUCCESS] Downloaded certificates for 2/2 host(s). Trusting certificates for 2 host(s): 192.168.1.51 [Trusted: SUCCESS] 192.168.1.109 [Trusted: SUCCESS] Trusted 2/2 downloaded certificates. root@Destination-vCD-Appliance [ /DestinationCerts ]# |
13. Start vCloud Director service.
1 2 3 |
root@Destination-vCD-Appliance [ / ]# service vmware-vcd start |
Then check vCD Applications logs to check if they are starting properly.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
root@Destination-vCD-Appliance [ / ]# cat /opt/vmware/vcloud-director/logs/cell.log Bootstrap application: start All required system properties are present Actual Java version (1.8.0_281) matches expected version (1.8.0_281) All required local configuration properties are present Successfully bound network port: 80 on host address: 192.168.1.110 Successfully bound network port: 443 on host address: 192.168.1.110 Successfully bound network port: 8999 on host address: 192.168.1.110 All required local configuration properties are present Successfully initialized system cryptography Successfully configured HTTP SSL Connector from certificate store Current locale "en" verified successfully. Bootstrap application: complete in 8,638ms .................. Application startup event: Subsystem 'CarePackage Cell Application' startup initiated. Application startup begins: Subsystem 'CarePackage Cell Application' at 5/22/21 5:07 PM Application Initialization: 'CarePackage Cell Application' 33% complete. Subsystem 'com.vmware.vcloud-common-cell-impl' started Application Initialization: 'CarePackage Cell Application' 66% complete. Subsystem 'com.vmware.vcloud.common-util' started Application Initialization: 'Legacy Cell Application' 95% complete. Subsystem 'com.vmware.vcloud.multi-site-api' started Application Initialization: 'Legacy Cell Application' 100% complete. Subsystem 'com.vmware.vcloud.rest-api-handlers' started Application Initialization: 'Legacy Cell Application' complete. Application Initialization: 'CarePackage Cell Application' 100% complete. Subsystem 'com.vmware.vcloud.rest-api-handlers' started Application Initialization: 'CarePackage Cell Application' complete. Application Initialization: 'Autoscale Cell Application' 100% complete. Subsystem 'com.vmware.vcloud.rest-api-handlers' started Application Initialization: 'Autoscale Cell Application' complete. Successfully handled all queued events. Application Initialization: 'Networking Cell Application' 100% complete. Subsystem 'com.vmware.vcloud.networking-web' started Application Initialization: 'Networking Cell Application' complete. Cell startup completed in 2m 04s root@Destination-vCD-Appliance [ / ]# |
All Applications and vCD Cells have started 100%.
Now Login to your vCD Service Provider Admin Portal with; https://eth0_IP_new_cell/provider. In my case is https://192.168.1.110/provider.
Check if Organizations are in the new cloud director. Has we can see in the next image, the organization exists.
Open a Tenant and Power ON some vApps and VMs, and all is working without any errors.
With this last step, we have our Linux vCloud Director with an embedded Postgres DB SQL migrated to a new vCloud Director Appliance with embedded Postgres DB.
With these vCloud Director Migrations: Linux vCD to vCD Appliance – Part 3, I finish this vCloud Migrations series. I hope these 3 blog posts help you understand better the steps to these migrations. As I said in part 2, VMware documentation is a bit confused and unclear with the steps we need to do.
vCloud Director migrations series:
- vCloud Director Linux migration SQL DB to embedded PostgreSQL appliance – Part 1
- vCloud Director Migrations: Linux vCD external SQL DB to vCD Appliance – Part 2
- vCloud Director Migrations: Linux vCD to vCD Appliance – Part 3
Share this article if you think it is worth sharing. If you have any questions or comments, comment here, or contact me on Twitter.
Leave A Comment
You must be logged in to post a comment.