Google Cloud Platform (GCP)¶
Provisioning Virtual Machines
Private and Local Images
Google VM Snapshots
Shared Network Support
Requirements for Integration with Morpheus¶
To integrate Morpheus with Google Cloud Platform, you will need the following:
The Compute Engine API enabled in GCP “APIs & Services”
Credentials for an IAM service account with Owner or Compute Admin role permissions
The Project ID, private key, and client email for the service account
This integration guide goes through the process of configuring your account and obtaining the information necessary to integrate with Morpheus.
Enabling the Compute Engine API¶
Log into the Google Cloud Platform web console
Hover over the “APIs & Services” menu and click on Dashboard
Click + ENABLE APIS AND SERVICES
In the search bar, search for “Compute Engine API”
Select “Compute Engine API” and click ENABLE. It may take a few moments for the API to be fully enabled
If the button is labeled MANAGE rather than ENABLE, the API is already enabled.
Creating a Service Account¶
From the landing page of the GCP web console, hover over the “IAM & Admin” menu and click on “Service Accounts”
Click + CREATE SERVICE ACCOUNT
Enter at least a name for your new service and click CREATE
After creating the service account, you’ll be prompted to set a role for the account. In order to fully integrate with Morpheus, you must use an account in the Owner role or the Compute Admin role
Following creation of the service account, you’ll be taken back to the list of existing service accounts
Generating Keys and Integrating with Morpheus¶
From the list of service accounts, click the ellipsis button (…)
Click “Create Key”
Select JSON format and click CREATE
A JSON-formatted document will be downloaded, this document contains the Project ID, private key, and client email values needed to complete the integration process in the next step
Add a GCP Cloud¶
The JSON-formatted document downloaded when creating a key for your service account contains all of the required values for completing the integration. Consult the above section on generating keys if needed.
Navigate to Infrastructure > Clouds
Select + CREATE CLOUD, select Google Cloud, and then click NEXT.
Enter the following into the Create Cloud modal:
Name of the Cloud in Morpheus
Unique code used for api/cli, automation and policies.
Description field for adding notes on the cloud, such as location.
For setting cloud permissions in a multi-tenant environment. Not applicable in single tenant environments.
If Visibility is set to Private, select the Tenant the Cloud resources will assigned to.
When disabled, automatic Cloud sync is paused and the Cloud will not be selectable for provisioning.
- AUTOMATICALLY POWER ON VMS
When enabled, Morpheus will maintain the expected power state of managed VMs. Morpheus will power on any managed VMs in the Cloud that have been shut down for unknown reasons (not powered off by Morpheus) to ensure availability of services.
When “AUTOMATICALLY POWER ON VMS” is enabled, the power state of managed VMs should be maintained in Morpheus. This setting is not applicable to discovered/unmanaged resources.
- PROJECT ID
Google Cloud Project ID
- PRIVATE KEY
The service account private key. Paste in the entire value between (but not including) the quotation marks in your downloaded JSON document, formatted like the following example:
`-----BEGIN PRIVATE KEY-----(your_key)-----END PRIVATE KEY-----`
- CLIENT EMAIL
The service account client email, ex: email@example.com
Regions will auto-populate upon successful authentication with the above credentials. If no regions are found, double check your entered credentials and try again. Select the appropriate region for this Cloud
- INVENTORY EXISTING INSTANCES
If checked, existing Google Instances will be inventoried and appear as unmanaged virtual machines in Morpheus.
Morpheus scopes Clouds to single regions. Multiple clouds can be added for multi-region support, and then optionally added to the same group.
If advanced options are not needed, click NEXT to advance to the Group selection page. Otherwise, continue on with this guide and review advanced or provisioning options.
Specify a default domain for instances provisioned to this Cloud.
- SCALE PRIORITY
Only affects Docker Provisioning. Specifies the priority with which an instance will scale into the cloud. A lower priority number means this cloud integration will take scale precedence over other cloud integrations in the group.
- APPLIANCE URL
Alternate Appliance url for scenarios when the default Appliance URL (configured in admin -> settings) is not reachable or resolvable for Instances provisioned in this cloud. The Appliance URL is used for Agent install and reporting.
- TIME ZONE
Configures the time zone on provisioned VM’s if necessary.
- DATACENTER ID
Used for differentiating pricing among multiple datacenters. Leave blank unless prices are properly configured.
- NETWORK MODE
Unmanaged or select a Network Integration (NSX, ACI etc)
- LOCAL FIREWALL
On or Off. Enable to managed Host and VM firewall/IP Table rules (linux only)
- SECURITY SERVER
Security Server setting is for Security Service Integrations such as ACI
- TRUST PROVIDER
Select Internal (Morpheus) or an existing Trust Provider Integration
- STORAGE MODE
Single Disk, LVM or Clustered
- BACKUP PROVIDER
Select Internal Backups (Morpheus) or a Backup Integration
- REPLICATION PROVIDER
Sets the default Replication Provider for the Cloud. Select an existing Replication Provider Integration
Enable Guidance recommendations on cloud resources.
Enable for Morpheus to sync Costing data from the Cloud provider, when available. If your organization utilizes reserved instances and you want to pull in related pricing data, select Costing and Reservations. If this is not relevant, select Costing to save money on additional calls to the AWS Cost Explorer API or similar service for other clouds.
- DNS INTEGRATION
Records for instances provisioned in this cloud will be added to selected DNS integration.
- SERVICE REGISTRY
Services for instances provisioned in this cloud will be added to selected Service Registry integration.
- CONFIG MANAGEMENT
Select a Chef, Salt, Ansible or Puppet integration to be used with this Cloud.
Select CMDB Integration to automatically update selected CMDB.
- CMDB DISCOVERY
When checked, any automatically discovered (unmanaged) servers onboarded into Morpheus from this Cloud will also have CMDB records created for them.
- CHANGE MANAGEMENT
Select an existing Change Management Integration to set on the Cloud. ex: Cherwell
- AGENT INSTALL MODE
SSH / WINRM: Morpheus will use SSH or WINRM for Agent install.
Cloud Init / Unattend (when available): (DEFAULT) Morpheus will utilize Cloud-Init or Cloudbase-Init for agent install when provisioning images with Cloud-Init/Cloudbase-Init installed. Morpheus will fall back on SSH or WINRM if cloud-init is not installed on the provisioned image. Morpheus will also add Agent installation to Windows unattend.xml data when performing Guest Customizations or utilizing syspreped images.
- API PROXY
Set a proxy for outbound communication from the Morpheus Appliance to the Cloud endpoints. Proxies can be added in the Infrastructure -> Networks -> Proxies tab.
- INSTALL AGENT
Enable to have Agent Installation on by default for all provisioning into this Cloud. Disable for Agent Installation to be off by default for all provisioning into this Cloud.
Set a proxy for inbound communication from Instances to the Morpheus Appliance. Proxies can be added in the Infrastructure -> Networks -> Proxies tab.
- Bypass Proxy for Appliance URL
Enable to bypass proxy settings (if added) for Morpheus Agent communication to the Appliance URL.
- NO PROXY
Include a list of IP addresses or name servers to exclude from proxy traversal
- USER DATA (LINUX)
Add cloud-init user data. Morpheus 4.1.0 and earlier assumes bash syntax. Morpheus 4.1.1 and later supports all User Data formats. Refer to https://cloudinit.readthedocs.io/en/latest/topics/format.html for more information.
After reviewing all options, click NEXT to advance to the Group selection page. Following Group selection, click COMPLETE to finish the integration process. If you’ve opted to inventory existing Instances, they will be viewable in Morpheus shortly. At this point, you are ready to provision new resources in Google Cloud Platform as needed!
If you experience difficulties adding a GCP Cloud, review the above guide and ensure you’ve met all requirements for completing the integration. For example, if the Compute Engine API is not enabled, Morpheus will not accept credentials entered on the Create Cloud modal. If you repeatedly run into problems completing the integration process, review the above guide in its entirely and double check that each step is completed and your account meets all configuration requirements.
Morpheus can add custom metatdata that will be injected into the unattend conf by GCP during provisioning. This is required for customizations including setting the Windows Administrator password during provisioning. GCP Windows Images must be syspreped using the
GCESysprep command prior to image creation, and must have platform/os set on the Virtul Image record in Morpheus after image sync for successful customization and Agent Installation.
GCP Windows Requirements¶
GCP Windows Images must be syspreped using the
GCESysprepcommand prior to Image creation in GCP. Refer to Googles “creating-windows-os-image” doc.
Once the Image is synced into Morpheus, the Platform (Windows, Windows 2016 etc) must be set on the Morpheus Virtual Image record, otherwise linux is assumed and the metadata will not be generated correctly.
The Global Windows “Administrator” password must be set in Morpheus under
/admin/provisioning/settings-> Windows Settings -> Administrator Password, or Administrator and password defined on the Morpheus Virtual Image record.
Be aware the unattend configuration during startup after sysprep delays causes a reboot and a prolonged finalization process during provisioning, and console/rdp may not be available during this time as windows is configuring.
Some Google provided Windows Images have slow startups that cause the Morpheus Agent service to not start within the default 30 second service startup timeframe, including after initial reboot after sysprep/unattend configuration. This can be adjusted by running
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\" -Name "ServicesPipeTimeout" -PropertyType DWORD -Value 180000 in powershell on the Windows Image.
Failure to use a GCP Windows Image that has not been sysprepped using
GCESysprep will cause Agent Installation, Automation, and Console issues as Morpheus will not be able to set user credentials and authenticate.