How to install pint utility on SLES machines.
zypp in python-susepubliccloudinfo |
Once installed, you can run
pint amazon servers –region='us-east-1' pint google servers –region='us-central1' pint microsoft servers –region='eastus' |
cloud engineer
How to install pint utility on SLES machines.
zypp in python-susepubliccloudinfo |
zypp in python-susepubliccloudinfo
Once installed, you can run
pint amazon servers –region='us-east-1' pint google servers –region='us-central1' pint microsoft servers –region='eastus' |
pint amazon servers –region='us-east-1' pint google servers –region='us-central1' pint microsoft servers –region='eastus'
Here’s the command to capture a GCP VM serial port output to your terminal.
gcloud compute instances get-serial-port-output servername \ --zone us-central1-f \ --project your-project \ --port 1 |
gcloud compute instances get-serial-port-output servername \ --zone us-central1-f \ --project your-project \ --port 1
You can also send the output to a file.
gcloud compute instances get-serial-port-output servername \ --zone us-central1-f \ --project your-project \ --port 1 > output.txt |
gcloud compute instances get-serial-port-output servername \ --zone us-central1-f \ --project your-project \ --port 1 > output.txt
When you exhausted all efforts trying to login to a VM and there’s no other way to log in to the server, here’s a breakglass method to allow you to log in to a VM via a startup script. Just add the following bash script to the VM startup section. Change the username and password to your liking. Restart the server to trigger the startup script. After reboot, it should give you access to the server. In addition, you will also have sudo access so you can switch as root.
1. Edit the VM.
2. Go to the Startup script section and add the following.
#!/bin/bash user="johndoe" pass="password" if id $user >/dev/null 2>&1; then exit else adduser echo $user:$pass | chpasswd usermod -aG google-sudoers $user fi |
#!/bin/bash user="johndoe" pass="password" if id $user >/dev/null 2>&1; then exit else adduser echo $user:$pass | chpasswd usermod -aG google-sudoers $user fi
3. Restart the server.
4. Log in as user.
5. Fix the login issue.
6. Remove user.
7. Remove the startup script.