skip to Main Content

how to hostname and IP address of the instances deployment from the deployment manager for a particular deployment session?

I have seen it can be done via gcloud but I am looking for alternate via saving files through jinja

Also, would like to know if we can save via Jinja templates

need to know if there are any postscript available for gcloud deployment manager

for example, I have deployed 4 centos instances and now I need to create a config file using the above four instances and then go about starting services on all four.

I doubt it can be done through start-up script

2

Answers


  1. You can simulate a creation of a vm instance reserving the desired IP, specifying the hostname and the start-up script where you start the services of your machines, then, check the REST file at the bottom of the page to see the actual labels used for that and where those should be used, but remember that for IP static assign you must reserve one or more first, for internals check this, for externals check this.

    Login or Signup to reply.
  2. You can create an instance-templates based on this documentation[1] and deploying your VM/s with gcloud[2]. The Hostname and IP Address can be specified on the instance template itself:

    gcloud deployment-manager deployments create [DEPLOYMENT_NAME]
    –config [CONFIG.YAML]

    I am not familiar with Jinja but based on Google doc [3], you can use it to create templates used by Deployment Manager.

    You can also add a metadata resource in the template to use the startup-script[4]. Keep in mind that startup-script can simply download and execute a python/bash if it is come to be too complex.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search