Managing vms in other project

This section describes how to use Money Saver VM to autostart preemptible vms from other projects.

  1. Provision preemptible vms in other projects.
preemptible vms in other project

  1. To start preemptible vms from other projects,edit the money-saver vm's metadata as below:
  • a. for first project , key=project1 , value=first project id.
  • b. for second project, key=project2 , value= second project id and so on .
  • /img/gcp/money-saver-vm/money-saver-metadata.png

    1. Add the service key of Money Saver project in other projects.To add the service key follow below steps:
  • a. Run the gcloud auth list command in money saver vm.It will give a service key.
  • /img/gcp/money-saver-vm/money-saver-service-key.png

  • b. Copy this service key,Go to other project,click on IAM then choose ADD , paste the service key in New Member and select compute engine admin V1 as role and Save.
  • /img/gcp/money-saver-vm/money-saver-IAM-role.png

    1. Now preemptible vms from other projects will autostart with the Money Saver VM
    2. see the logs of money-saver vm
    3. /img/gcp/money-saver-vm/money-saver-other-project-logs.png

    4. Just like for the home project, to skip any preemptible vm from auto start from other project, set a key autostart with a value no in that respective vms metadata.
    5. /img/gcp/money-saver-vm/money-saver-autostart-no.png

    6. To see the money saver vm logs,connect this vm via ssh and run tail command tail -f /var/log/money-saver-vm.log for monitoring.
  • Also see how money-saver vm works in home project