This section describes how to use Money Saver VM to autostart preemptible vms from other projects.
- Provision preemptible vms in other projects.
a. for first project , key=project1 , value=first project id.
b. for second project, key=project2 , value= second project id and so on .
- To start preemptible vms from other projects,edit the money-saver vm's metadata as below:
a. Run the gcloud auth list command in money saver vm.It will give a service key.
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.
- Add the service key of Money Saver project in other projects.To add the service key follow below steps:
Also see how money-saver vm works in home project
- Now preemptible vms from other projects will autostart with the Money Saver VM
- see the logs of money-saver vm
- 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.
- 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.