This document provides instructions for setting up a new Compute Engine VM instance in GCP using Ubuntu 20.04 LTS with PostgreSQL installed and ready to use with CloudM Migrate. It assumes that you have prior knowledge of creating VM instances in Google Compute Engine. The process involves configuring metadata keys, applying a startup script, verifying the system logs, and installing CloudM to connect to the new PostgreSQL server.
Prerequisites
-
Access to Google Cloud Platform to create a Compute Engine instance
-
Ubuntu 20.04 LTS image
-
Administrative access to create and configure metadata
- Download the bash script here: ServerSetup.sh
Steps to Create and Configure the VM
1. Create Metadata Keys
When creating a new VM, add the following metadata keys and populate them with appropriate values:
-
pg_user
: PostgreSQL username -
pg_password
: PostgreSQL password
Example:
Note: This method is a temporary solution for beta testing. A more secure approach will be considered for the release.
2. Apply Startup Script
Copy and paste the provided startup script into the VM's startup script section before finalizing the VM creation process.
The startup script will execute during the initial boot and log its output to the serial port for debugging purposes.
3. Finalize VM Creation
After setting the metadata keys and pasting the startup script:
-
Click Create to launch the VM.
-
Monitor the serial port logs to verify successful execution.
Logging and Debugging
The attached startup script logs output to the serial port. To view logs:
-
Navigate to the VM instance in the cloud console.
-
Access the Serial Port Output section.
-
Review logs for any errors or confirmations of successful execution.
Installing CloudM and connecting to the PostgreSQL server
-
Download the latest installer from the Migrate Release Notes page.
-
Launch the installer on the target server.
-
Agree to the terms and conditions, then click Next.
-
Configure the installation:
-
Select Advanced as the installation type.
- Ensure Install Primary Service and Web Application is checked.
- Decide whether you want to install the secondary service or not.
- This will depend on whether or not you are creating a multi-server migration environment. You can find more information on the services here: Installation options
-
Ensure Use Existing PostgreSQL is checked.
- Enter the hostname of the PostgreSQL server as the Postgre Host.
- Enter 5432 as the Postgres Port.
- This is the port the provided script installs PostgreSQL on. If you have installed this on a custom port, please enter that port. You will also need to ensure the PostgreSQL server is accessible on that port from the migration server.
- Enter a name for the Database, by default this is "poweredby".
- Enter the User Name for the PostgreSQL server.
- This will be the pg_user specified for the setup script.
- Enter the Password for the PostgreSQL server.
- This will be the pg_password specified for the setup script.
-
Enter an email address and password (these will be your login credentials for the web interface).
-
Leave other settings as default.
-
-
Click Install to begin the installation.
After completing the installation, you can log in to CloudM Migrate using the credentials you specified. To do so, open a web browser on the same server and navigate to https://cloudm.local.
Future Improvements
Passing sensitive information via metadata keys is not considered best practice. Future iterations will focus on implementing a more secure approach to credential management.