Custom GCP image
Vertica publishes a Google Cloud Platform (GCP) image that contains third-party libraries and other software that is required to install and operate the Management Console (MC) instance and Vertica database cluster instances. In some circumstances, you might need to add customizations to your MC environment, such as monitoring or security updates.
You cannot modify the published Vertica image directly, but you can create a custom image from the published image with your customizations. You can select this custom image when you create or revive a cluster.
Prerequisites
GCP account with administrative rights.
Create a custom GCP image
To create a custom GCP image, you must launch a base Virtual Machine (VM) instance from the published Vertica image so that you can make your changes. After you create this base instance, you can save it as a custom image.
Create the base instance
To begin, you must create an instance that includes the published Vertica image. This is a temporary instance that you can delete after you create the custom image:
- Log in to GCP.
- From the GCP console, go to Compute Engine.
- In the side navigation bar, go to Storage > Images.
- Filter the images table for the published Vertica image that you want to use in the base instance. For example, filter for
vertica-23-4-0
to customize the 23.4.0-x image. - Copy the name of the published Vertica image and save it for later use.
- Go to Virtual machines > VM instances in the side navigation bar.
- Select CREATE INSTANCE.
- Enter a name for your instance.
- Select a region.
- Scroll down to Boot disk, and select CHANGE.
- In the Boot disk window, select the CUSTOM IMAGES tab.
- In the image field, paste the name of the published Vertica image to filter the image list.
- Select SELECT. The Boot disk window closes and you return to Create an instance.
- Select CREATE to create the base instance.
After you select CREATE, you return to Virtual machines > VM instances in Compute Engine. When GCP finishes creating the base instance, you have a running instance that you can access and customize.
Customize the base instance
Note
This section requires access to a separate machine and its public SSH key so you can connect to the base instance and install customizations. You cannot customize the base instance with SSH on the GCP portal or gcloud compute SSH.
To generate a public and private keypair, use the ssh-keygen
command, and answer the prompts:
$ ssh-keygen -t rsa -b 4096 -C gcpAdminUsername
Generating public/private rsa key pair.
Enter file in which to save the key: /path/to/gcp_custom_keys
...
Your public key has been saved in /path/to/gcp_custom_keys.pub
...
The preceding ssh-keygen
command includes the following options:
t
: Type of key to create. This example creates a key with thersa
algorithm.b
: Number of bits in the key. This example creates a key with 4096 bits.C
: Adds a comment to help identify the key. Specify your GCP administrator username with this option. If you do not use this option, the command generates the comment asuser
@hostname
, and you must manually remove the@hostname
portion.
After you create the base instance, add the contents of your public key to the instance so you can SSH into the machine to add customizations or configurations:
- In Virtual machines > VM instances, filter for the base instance.
- Select the instance name. The instance Details tab displays.
- Select EDIT in the top menu.
- In Security and access > SSH Keys, select ADD ITEM.
- In the SSH key 1 * field, paste the contents of the public SSH key that you just created.
Important
If you use public key with the default comment format, do not include the@
hostname
portion of the comment. The key that you paste into SSH key 1 * must end withusername
. - Select SAVE.
- Return to the VM instances window, go to the Network interfaces section and retrieve the External IP address for the base instance.
- Remotely log in to the base instance with the user string from the public key. The
-i
option uses the local machine's private key for authentication:$ ssh -i path/to/.ssh/private-key username@baseInstanceExternalIPAddress
- Add custom configurations to the base instance environment.
Now, the base instance includes the published Vertica base image, and any custom configurations.
Create the custom image
After you customize the base instance, you can create a new image that includes the published Vertica base image and your customizations:
- On Virtual Machines > VM instances, select the base instance and select STOP.
- After the instance stops, select the instance name in the list. The image DETAILS tab displays.
- Scroll to the Boot disk section. In the Name column, select the instance name.
- In the top navigation bar, select CREATE IMAGE. The Create an image page displays.
- In the Name field, enter a name for the instance. You must use the following naming convention, or the MC cannot identity the image when you create or revive a cluster:
For example, the following name uses Vertica version 12, minor release 0, service pack 0, hotfix zero:vertica-major-minor-servicepack-hotfix-imageName
vertica-12-0-0-0-customImageName
- Verify that Source disk lists the base instance name.
- Select CREATE.
- Record the name of the image that you just created so you can enter it in the MC.
After GCP creates the image, you have a custom image that includes the published Vertica base image, and any environment customizations. This custom image is available in the current GCP project.
If you no longer need the customized base instance, you can delete it from your GCP VM instances.
Select the custom image in MC
Important
This section requires that you enter the custom image name in the MC. To retrieve the name, log in to the GCP portal and go to Compute Engine > Storage > Images.After you create the custom image in GCP, return to the MC and use the custom image in a workflow:
- Log into the MC and begin one of the following workflows:
- Create database cluster
- Revive cluster
- On the wizard page Enter Vertica database name and login credentials, select the Use Custom Image box.
- In Custom Image Name, enter the custom image name. For example,
vertica-23-4-0-0-
customImageName
. - Complete the create or revive workflow.
After you complete the workflow, any new or revived Vertica database cluster instances run the custom image. If you scale a new or revived cluster, the added instances use the same custom image.