Study/Cloud

[GCP google-cloud-sdk 시작]

nobang 2022. 2. 16. 08:38
728x90

GCP 로그인 후 화면 우측 상단에서 Cloud shell 버튼을 클릭하여 터미널을 연다.
(프로젝트도 선택된다)

Welcome to Cloud Shell! Type "help" to get started.
Your Cloud Platform project in this session is set to <프로젝트ID>.
Use “gcloud config set project [PROJECT_ID]” to change to a different project.
idogfootman@cloudshell:~ (프로젝트ID)$

터미널에서
gcloud init 을 했더니... (이미 선택되어있었지만)
다시 어떤 프로젝트 환경설정을 할 것인지 정하라고 하네
현재 프로젝트번호를 입력하면
기본 region/zone을 선택하라고 함.

zone 번호를 선택하면 자동으로 region과 zone이 할당 됨.

gcloud list 로 현재 프로젝트 설정을 보여 줌.

test로 vm을 하나 만들어보면 

gcloud compute instances create demo-vm1\
--image-family ubuntu-minimal-2004-lts \
--image-project ubuntu-os-cloud \
--boot-disk-size 10GB \
--machine-type f1-micro

WARNING: You have selected a disk size of under [200GB]. This may result in poor I/O performance. For more information, see: https://developers.google.com/compute/docs/disks#performance.
Created [https://www.googleapis.com/compute/v1/projects/yhnoh-335705/zones/asia-southeast1-a/instances/demo-vm1].
NAME: demo-vm1
ZONE: asia-southeast1-a
MACHINE_TYPE: f1-micro
PREEMPTIBLE:
INTERNAL_IP: 10.148.0.xx
EXTERNAL_IP: 34.124.146.xx
STATUS: RUNNING

간단하게 만들어졌다.

728x90