Updated 2018-10-23: Added information about GCP Compute Engine API and the GCP account privileges/Role assignment required.
———————————————————————————————
One of the new features included in the Nutanix Prism Central (PC) 5.7 UI is the option to connect the Apps (Calm product) section to Google Cloud Platform (GCP) and manage your workload. This blog post will cover the PC Apps to GCP configuration and another one will show how to manage your apps in GCP. This blog post is divided into three sections:
GCP Configuration
Follow the below steps to setup a GCP connection in Calm and make it possible for a project to use GCP as a target.
- Log in to GCP and search for “Service accounts”.
- If you don’t have a Service Account, you need to create one and the required account privileges/Role assignment depends on your use case.
The Service Account used in this blog post has the Compute Admin Role which is found via Compute Engine section in the Role configuration.
- This account is already associated with a Key but we’ll create a new one. Click the three dots to the right and select “Create Key”
- Select download forma, use JSON.
- Just info about that you should treat this key like an important asset.
- Make sure Compute Engine API is enabled by searching for “Compute Engine API” in the GCP console, click Overview and press Enable.
Once done you should have an option to “DISABLE API”
PC Apps Configuration
Now we have the GCP key required to establish the connection from PC Apps to GCP. Follow these steps.
- Log in to PC, select Apps and click settings on the right hand side
- Click “Add Settings”
- Give the new setting a:
- Click “Service Account File” and select the one you just downloaded from GCP.
- When done you’ll see a bunch of fields filled out. Remove any potential Region you do not want to use. The regions are greyed out as well as some part of the Project ID in the below print screen.
- Click Save
- Click Verify
- Now if you check the Apps, Settings section you’ll see the newly GCP setting added and verified.
- Last thing is to add the GCP images you want to make available. Click the check-box next to the newly created GCP type and use the drop-down. on the right-hand side to add the images.
PC Self Service Project Configuration
Last this will be to enable GCP for a Self Service Project and I’ve decided to create a new project.
- Click Projects on the left hand side in the Apps section
- Click Create Project
- Fill out the following:
- Project Name
- Select the directory users and or groups and assign the appropriate Project roles. In my case I only added the group admin_gcp to the project.
- Select Infrastructure. In my case I only selected “Local and Cloud resources” so I can deploy VMs both on-premises and to GCP. I selected:
- AHV Cluster = SolPerf01
- Network (AHV Network) = All
- For GCP i selected GCP_01 which I created in the PC Apps Configuration section.
- Click Save
- Click Environment to configure GCP
- Create two credentials.
Note: These credentials will be use for direct launch of MarketPlace blueprints from MarketPlace manager. Custom user created blueprints will still need their own credentials created during configuration.- Password based
- SSH Key based and you must use an SSH Key without a password so the PC can login to the VM and do post configuration tasks. I used the following keygen command, ssh-keygen -t rsa -C centos@nutanix.com (but sue whatever username you want) , on my MacBook to create a key pair. Fill out.
- Fill out the following in the VM Configuration section for AHV on Nutanix. This is not needed, unless you will deploy Marketplace blueprint from Marketplace manager, but the information provided at the Project level can be used when creating a Blueprint, via the Blueprint “Clone from environment” feature, so you won’t have to fill out everything again.
- VM Name
- Image – One available from the Image Service
- Device Type = Disk
- Device Bus = SCSI
- Check Bootable – You can add additional disk if needed
- vCPUs = Give whatever value you want to use as default
- Core per vCPU = Give whatever value you want to use as default
- vCPU = Give whatever value you want to use as default
- Memory (GiB) = Give whatever value you want to use as default
- NIC 1 = Select your default network
- Connection
- Check the check box “Check log-in upon create” and use
- The on-premises credentials created earlier
- NIC1 since that is the only one we currently have
- SSH connection type
- leave rest default
- Check the check box “Check log-in upon create” and use
- The rest (VDISK, VGPU, CATEGORIES) of the values I didn’t touch.
- Fill out the following in the VM Configuration section for GCP:
- Instance Name = What you want. If you try characters not allowed, you’ll be notified.
- GCP Zone = The one you want to use as default for the Project.
- GCP Machine Type = The one you want to use as a default
- Boot Disk
- Now on to the Network and SSH section section. Fill out:
- The last section includes
If you click the “Running Man” next to the option so he turns blue you can change the default value when you Launch the Blueprint.