| #!/bin/bash |
| # |
| # Creates the compute instance for skia-monitoring. |
| # |
| set -x |
| |
| source vm_config.sh |
| |
| MONITORING_MACHINE_TYPE=n1-highmem-16 |
| MONITORING_SOURCE_SNAPSHOT=skia-pushable-base |
| MONITORING_SCOPES='https://www.googleapis.com/auth/devstorage.full_control' |
| MONITORING_IP_ADDRESS=108.170.219.115 |
| |
| # Create a boot disk from the pushable base snapshot. |
| gcloud compute --project $PROJECT_ID disks create $INSTANCE_NAME \ |
| --zone $ZONE \ |
| --source-snapshot $MONITORING_SOURCE_SNAPSHOT \ |
| --type "pd-standard" |
| |
| # Create a large data disk. |
| gcloud compute --project $PROJECT_ID disks create $INSTANCE_NAME"-data" \ |
| --size "1000" \ |
| --zone $ZONE \ |
| --type "pd-standard" |
| |
| # Create the instance with the two disks attached. |
| gcloud compute --project $PROJECT_ID instances create $INSTANCE_NAME \ |
| --zone $ZONE \ |
| --machine-type $MONITORING_MACHINE_TYPE \ |
| --network "default" \ |
| --maintenance-policy "MIGRATE" \ |
| --scopes $MONITORING_SCOPES \ |
| --tags "http-server" "https-server" \ |
| --metadata-from-file "startup-script=startup-script.sh" \ |
| --disk name=${INSTANCE_NAME} device-name=${INSTANCE_NAME} "mode=rw" "boot=yes" "auto-delete=yes" \ |
| --disk name=${INSTANCE_NAME}-data device-name=${INSTANCE_NAME}-data "mode=rw" "boot=no" \ |
| --address=$MONITORING_IP_ADDRESS |