Hello,
Is it the best practice to create Golden image/ template with Morpheus agent installed?
Thank you.
Hello,
Is it the best practice to create Golden image/ template with Morpheus agent installed?
Thank you.
In practice this may not save much effort.
Each VMs agent connects with the appliance with a unique API key so that Morpheus can manage the various connections and data it receives. You’d need to find this for the provisioned VM and update it in the morpheus-node.rb
file
cat /etc/morpheus/morpheus-node.rb
Shows this (and more):
package['appliance_url'] = 'https://<url>/'
package['iface'] = 'eth0'
package['api_token'] = '39f0ab2c-405f-4e70-23435235235' ## API key for this VM
...
You’d also want Morpheus to be able to manage the agent in order to upgrade it, which requires the same connectivity as installing it.
Hi,
We typically use the following code in the cloud-init ‘user_data’ section of our Terraform code when building VMs:
<%=instance.cloudConfig.agentInstall%>
<%=instance.cloudConfig.finalizeServer%>
This gets translated by Morpheus (before the Terraform code runs on the Morpheus Appliance) to two curl commands with the unique API key embedded that Ollie mentioned in his response. Then once the VM starts and cloud-init runs, these two curl commands do their job to download the Morpheus Agent from the Morpheus Appliance and registers the VM’s agent within Morpheus.
Pre-installing the Morpheus agent code onto the image and then trying to figure out the unique API and modifying the various Morpheus agent config files is a lot more difficult than using the cloud-init and the two pieces of Groovy variable substitutions in the Terraform (or Cloud Formation / ARM) code.
Some instance types have a checkmark that allows you to state if the agent needs to be installed or not. Morpheus will then inject these two lines of code automatically in the cloud-init user_data phase.
-Yaron.