The storage on my Google Cloud Compute Engine Instance (inadvertently) got completely used up. I can no longer SSH into my instance. I have increased the space on my instance, but it still will not allow me to SSH. My VM operating system is Ubuntu.
I have tried two things:
1.) I have tried creating a start script to remove a large directory to clear up some space. Under “custom metadata” I have set the key as “startup-script” and the value as
#! /bin/bash
rm /home/myusername/dir-to-rm
I save and reset the instance, click “connect to serial console”, but I still cannot SSH.
2.) I have tried to use a startup script to set a login username and password for the serial console by using the same method, but with the following script:
#! /bin/bash
sudo useradd tmpuser
echo 'tmpuser:password' | chpasswd
Neither of these methods have allowed me to SSH back into the VM.
Any help would be greatly appreciated.