WPCloudDeploy Documentation

Google Compute Engine: Introduction, Installation & Configuration Guide

Installing the Google Compute Platform (GCP) Provider

The Google Compute Platform provider is just a regular WordPress plugin – upload and activate it from the WordPress PLUGINS screen.

Prerequisites For Using the GCP Provider

Connecting to GCP and automatically creating servers requires a lot more moving parts to be synchronized than simpler providers such as DigitalOcean and Linode.  In particular:

  • You need to create a service account inside your project and download the service account JSON credentials file.  You can do this under IAM & ADMIN → SERVICE ACCOUNTS in the GCP console. The service accounts must have roles and rights to create/modify/delete VMS and related components (including manipulating the firewall).  The JSON file can be downloaded from the KEYS tab under the service account you created.

Configuring the GCP Provider

Unlike most other providers, you’ll need to configure both the public key and private key inside our settings screen.  For GCP, the public and private keys have very very specific requirements.

  • As mentioned above you’ll need an SSH Keypair (both parts – public and private)
  • The public key can only be the the public key text – the preamble such as ‘ssh-rsa’ and any trailing text such as a user name or email address must be removed.
  • The private key has the same rules.
  • The keypair must be an RSA keypair.
  • Also as mentioned above you’ll need the GCP JSON service account credentials file – make sure that it has the rights to create VM’s in the project.

On the SETTINGS screen (under WPCLOUDDEPLOY → SETTINGS → CLOUD PROVIDERS → GOOGLE):

  • Enter your PROJECT ID
  • Enter the contents of the Service Account JSON file
  • Click the SAVE button
  • Click the SAVE button AGAIN – this will reveal the rest of the settings screen.
  • Enter the PUBLIC KEY from your SSH key-pair
  • Choose a REGION
  • Enter the PRIVATE KEY from your SSH key-pair
  • Enter a password for the SSH private key (if any)
  • Click the SAVE button
  • Click the SAVE button again.

Using Multiple Regions And Multiple GCP Projects

The basic GCP provider can only be used in one region and one project.  In order to use it in multiple regions, you need to install the VIRTUAL PROVIDER add-on.  Once that has been installed, you can create a virtual provider for each region & project combination – learn more in the Virtual Provider documentation.


Compatibility Notes

  • In some cases this provider cannot be run in conjunction with Alibaba, Amazon EC2 and Amazon Lightsail.  This is because these providers all have APIs that use the same libraries – but different versions of those libraries which can sometimes conflict with each other. If you encounter this issue you must turn off the other providers before enabling this one. If you need to use these other providers as well you can create a new WPCD instance and use them there.

Limitations

Server Sync

Server Sync cannot be used on GCP servers – neither as source nor destination.

Site Sync

The function to copy a site to a new server will not work with this provider.

Deleting A Site

When deleting a site, the option to also delete all local backups will not work with this provider.


Known Issues

  • Server provisioning will sometimes randomly fail with a “Failed Quitting Process” message.  In this case you should delete the server from the WPCD dashboard and restart the process.  While all providers sometimes have incidents where the servers fail to deploy properly, GCP seems to have a much much higher failure rate – higher than everyone else except maybe DigitalOcean.  Note that this means that if you allow GCP servers with WooCommerce, you might have to keep a close eye on those servers during the provisioning process after an order is placed!
  • We have noticed that sometimes the GCP VMs randomly stop responding until you manually restart them from the GCP dashboard.  This seems to happen if you reboot the instance too many times in a short period of time.  There might be other actions that cause this behavior as well.  A key indicator that you are encountering this behavior is that you cannot SSH into the VM – you get a “connection refused” or similar message.  Once you restart from the GCP console you are able to SSH into the server again and everything else starts to work properly again.

Other Notes

Server Names

GCP requires your server names to be unique.  So, we will be adding a random 5 character string to the end of every server name you specify to avoid inadvertent duplicates.  For example, if you try to create a server with the name “MYNEWSERVER” we will convert it into something like “MYNEWSERVER-axytz”.

Default Disk Size

All servers, regardless of number of CPUs, will be provisioned with 50 GB of disk space.


 

Share: