-
Notifications
You must be signed in to change notification settings - Fork 2
OlegSmirnov GoogleCloudExperiments
o-smirnov edited this page Sep 23, 2014
·
5 revisions
gcloud auth login
gcloud config set project meerkat-7-gazing
gcloud config set compute/zone europe-west1-a
gsutil -m cp -R ~/RP-3C147/3C147-CD-LO.MS gs://oms/RP-3C147/
https://developers.google.com/compute/docs/disks
gcloud compute disks create oms-3c147-data --size 200
gcloud compute disks create oms-1 --source-snapshot oms-papino-3
gcloud compute disks create oms-1-data --size 200
gcloud compute instances create oms-1 --machine-type n1-standard-1 --disk name=oms-1 mode=rw boot=yes auto-delete=yes --disk name=oms-3c147-data mode=ro --disk name=oms-1-data mode=rw
Normally gcloud compute ssh oms-1
. Other option is ssh -o UserKnownHostsFile=/dev/null -o CheckHostIP=no -o StrictHostKeyChecking=no oms@130.211.55.16
, where the IP address may be looked up via
gcloud compute instances describe oms-1| grep natIP
# natIP: 130.211.55.16
Problem: Doing gcloud compute ssh
straight off the bat will sometimes come back with "ssh: Connection refused". Need a way to know the machine has come up and is ready for ssh connections!
# on the instance
ls -l /dev/disk/by-id/google-* # locate disks
sudo /usr/share/google/safe_format_and_mount -m "mkfs.ext4 -F" /dev/sdb /data-orig
sudo /usr/share/google/safe_format_and_mount -m "mkfs.ext4 -F" /dev/sdc /data
sudo mkdir /data/oms
sudo chown oms.oms /data/oms
ln -s /data/oms data
gcloud compute instances delete oms-1 --quiet
gcloud compute disks delete oms-1-data --quiet