Go back

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:
  1. Make sure Money-Saver VM is deployed and up and running in the project as perGCP Getting Started Guide .

  2. Create preemptible VMs for your computing needs by setting Preemptibility “On”

Maintenance tab

Preemptiblity on

  1. If this preemptible vm is stopped by GCP, money-saver vm will autostart it.

preemptible-vm-stopped

  1. Re-start activities of Preemptible VMs is stored in /var/log/money-saver-vm.log inside Money-Saver VM

money saver logs

  1. Now your preemptible vm is up and running

Preemptible vm

  1. 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

/img/gcp/money-saver-vm/preemptible-vm-autostart-no.png

  1. Now this vm will not autostart with money-saver vm.
Go back