Auto starting VMs within the same project
This section describes Money Saver VM to autostart the preemptible vms which are running in the same project.
The VM will run a script every two minutes to restart stopped preemptible vms only and not regular vms.
By default it will start all preemptible vms in the project where it is running.
- Follow below steps to use Money Saver VM with your GCP preemptible vms:
-
Make sure Money-Saver VM is deployed and up and running in the project as perGCP Getting Started Guide .
-
Create preemptible VMs for your computing needs by setting Preemptibility “On”
![Maintenance tab](https://techlatest.net/img/gcp/money-saver-vm/money-saver-vm-maintenance-tab.png)
![Preemptiblity on](https://techlatest.net/img/gcp/money-saver-vm/preemptible-vm.png)
- If this preemptible vm is stopped by GCP, money-saver vm will autostart it.
![preemptible-vm-stopped](https://techlatest.net/img/gcp/money-saver-vm/preemptible-vm-stopped.png)
- Re-start activities of Preemptible VMs is stored in /var/log/money-saver-vm.log inside Money-Saver VM
![money saver logs](https://techlatest.net/img/gcp/money-saver-vm/log-file.png)
- Now your preemptible vm is up and running
![Preemptible vm](https://techlatest.net/img/gcp/money-saver-vm/preemptible-vm-home.png)
- if you don’t want Money-Saver vm to autostart a specific Preemptible VM, set meta data of that VM with key=“autostart” and value=“no” as shown below.
![/img/gcp/money-saver-vm/money-saver-autostart-no.png](https://techlatest.net/img/gcp/money-saver-vm/money-saver-autostart-no.png)
![/img/gcp/money-saver-vm/preemptible-vm-autostart-no.png](https://techlatest.net/img/gcp/money-saver-vm/preemptible-vm-autostart-no.png)
- Now this vm will not autostart with money-saver vm.