Reputation: 101
The following documentation suggests that resetting a virtual machine on google compute engine will return a virtual machine to its original state
Performing a reset on your instance is similar to pressing the reset button on your computer, which wipes the memory contents of the machine and resets the virtual machine to its initial state.
https://cloud.google.com/compute/docs/instances/restarting-an-instance
Yet my files still appear on the VM after following this documentation to reset via to gui and via gcloud on terminal.
Am I misinterpreting this feature? Am I doing something incorrectly?
Thank you!
Upvotes: 9
Views: 18611
Reputation: 3438
You should think of restarting an instance in the same way as when you restart a physical machine. All of the programs you have installed and files you have modified/created will remain (apart from files in the /tmp directory as snakecharmerb pointed out).
If you would like to completely reset an instance to it's original, unmodified state, the most efficient method would be to simply create a new instance of the same specification (i.e. by selecting the same source image and machine settings), and then to delete the old/modified one.
If you modify an instance and want to save the state of the instance/disk so that you can revert back to that state, you can create an instance snapshot. This allows you to save a snapshot of the instances boot disk, so that you can create an identical instance at a later date. More information on this can be found here .
Upvotes: 10
Reputation: 101
snakecharmerb wrote,
My reading of that doc is that initial state is not the same as original state, so like rebooting a physical machine, RAM is initialised but files written to disk persist (with the possible exception of volatile directories like /tmp)
Upvotes: 0