Using the Developers Console, go to your project, then Compute-> Compute Engine-> VM instances, click on your VM instance and under 'Availability policies' make sure you VM instance is not a preemptible instance. Compute Engine might terminate (preempt) the instance if it requires access to those resources for other tasks. For more information on preemptible instances visit the article [1].
If your VM machine is not a preemptible instance, check the value for 'Automatic restart' option, if it is 'Off' change it to 'On' and for 'On host maintenance' option if the value is 'Terminate VM instance' change it to the 'Migrate VM instance' which are recommended values.
You can also check the availability policies (scheduling) options of your VM instance using the following gcloud command [1]:
$ gcloud compute instances describe INSTANCE_NAME --zone ZONE
Look at the output of the command for the scheduling options:
scheduling:
automaticRestart: true
onHostMaintenance: MIGRATE
preemptible: false
If the scheduling options values of your VM machine are different than the values specified above, use the following gcloud command [2] to modify them to the recommended values:
$ gcloud compute instances set-scheduling INSTANCE_NAME --maintenance-policy MIGRATE --restart-on-failure --zone ZONE
Regarding your question about static IP address, you can promote the ephemeral external IP address which is now being used by your VM machine to a static external IP address using this command [4]:
$ gcloud compute addresses create example-address-1 --addresses 162.222.181.197 --region us-central1
Otherwise, in Developers Console click on your VM instance, Edit the 'External IP' and change its value to 'New static IP address' which this will assign a new IP address to your VM instance.
Sincerely,
Kamran