์ด ๋ฌธ์์์๋ Compute Engine ์ธ์คํด์ค๋ฅผ ์ค์งํ๊ฑฐ๋ ๋ค์ ์์ํ๋ ๋ฐฉ๋ฒ์ ์ค๋ช ํฉ๋๋ค. ์ธ์คํด์ค ์ผ์์ค์ง, ์ค์ง ๋๋ ์ฌ์ค์ ์ ๊ดํ ์์ธํ ๋ด์ฉ์ Compute Engine ์ธ์คํด์ค ์ผ์์ค์ง, ์ค์ง ๋๋ ์ฌ์ค์ ์ ์ฐธ๊ณ ํ์ธ์.
์ธ์คํด์ค๋ฅผ ์ค์งํ๋ ๊ฒ์ ๋ ์ด์ ์ฌ์ฉํ์ง ์๊ฑฐ๋ ์์ฑ์ ์์ ํ ๋(์: ๋จธ์ ์ ํ์ ๋ณ๊ฒฝํ๊ฑฐ๋ ์ฐ๊ฒฐ๋ ๋์คํฌ ๋ฐ ๋ง์ดํธ๋ ๋์คํฌ๋ฅผ ์ญ์ ํ๋ ๊ฒฝ์ฐ) ์ ์ฉํฉ๋๋ค. ์ธ์คํด์ค๋ฅผ ์ค์งํ ํ์๋ ๋ค์ ์์ ์ ์ํํ ์ ์์ต๋๋ค.
๋ค์ ์์ํ์ฌ ์ํฌ๋ก๋๋ฅผ ์ฌ๊ฐํฉ๋๋ค.
๋ ์ด์ ํ์ํ์ง ์์ ๊ฒฝ์ฐ ์ญ์ ํฉ๋๋ค.
์ธ์คํด์ค ์ค์ง ๋๋ ๋ค์ ์์์ ์๋ํํ๋ ค๋ฉด ๋์ ๋ค์์ ์ฐธ๊ณ ํ์ธ์.
์์ํ๊ธฐ ์ ์
-
์์ง ์ธ์ฆ์ ์ค์ ํ์ง ์์๋ค๋ฉด ์ค์ ํฉ๋๋ค.
์ธ์ฆ์ Google Cloud ์๋น์ค ๋ฐ API์ ์ก์ธ์คํ๊ธฐ ์ํด ID๋ฅผ ํ์ธํ๋ ํ๋ก์ธ์ค์
๋๋ค.
๋ก์ปฌ ๊ฐ๋ฐ ํ๊ฒฝ์์ ์ฝ๋ ๋๋ ์ํ์ ์คํํ๋ ค๋ฉด ๋ค์ ์ต์
์ค ํ๋๋ฅผ ์ ํํ์ฌ Compute Engine์ ์ธ์ฆํ๋ฉด ๋ฉ๋๋ค.
Select the tab for how you plan to use the samples on this page:
Console
When you use the Google Cloud console to access Google Cloud services and APIs, you don't need to set up authentication.
gcloud
-
After installing the Google Cloud CLI, initialize it by running the following command:
gcloud init
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
- Set a default region and zone.
-
Install the Google Cloud CLI.
-
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
-
To initialize the gcloud CLI, run the following command:
gcloud init
-
If you're using a local shell, then create local authentication credentials for your user account:
gcloud auth application-default login
You don't need to do this if you're using Cloud Shell.
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
-
Install the Google Cloud CLI.
-
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
-
To initialize the gcloud CLI, run the following command:
gcloud init
-
If you're using a local shell, then create local authentication credentials for your user account:
gcloud auth application-default login
You don't need to do this if you're using Cloud Shell.
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
-
Install the Google Cloud CLI.
-
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
-
To initialize the gcloud CLI, run the following command:
gcloud init
-
If you're using a local shell, then create local authentication credentials for your user account:
gcloud auth application-default login
You don't need to do this if you're using Cloud Shell.
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
-
Install the Google Cloud CLI.
-
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
-
To initialize the gcloud CLI, run the following command:
gcloud init
-
If you're using a local shell, then create local authentication credentials for your user account:
gcloud auth application-default login
You don't need to do this if you're using Cloud Shell.
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
-
Install the Google Cloud CLI.
-
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
-
To initialize the gcloud CLI, run the following command:
gcloud init
-
If you're using a local shell, then create local authentication credentials for your user account:
gcloud auth application-default login
You don't need to do this if you're using Cloud Shell.
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
Go
๋ก์ปฌ ๊ฐ๋ฐ ํ๊ฒฝ์์ ์ด ํ์ด์ง์ Go ์ํ์ ์ฌ์ฉํ๋ ค๋ฉด gcloud CLI๋ฅผ ์ค์น ๋ฐ ์ด๊ธฐํํ ๋ค์ ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด๋ก ์ ํ๋ฆฌ์ผ์ด์ ๊ธฐ๋ณธ ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด๋ฅผ ์ค์ ํ์ธ์.
์์ธํ ๋ด์ฉ์ ๋ค์์ ์ฐธ์กฐํ์ธ์: Set up authentication for a local development environment.
Java
๋ก์ปฌ ๊ฐ๋ฐ ํ๊ฒฝ์์ ์ด ํ์ด์ง์ Java ์ํ์ ์ฌ์ฉํ๋ ค๋ฉด gcloud CLI๋ฅผ ์ค์น ๋ฐ ์ด๊ธฐํํ ๋ค์ ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด๋ก ์ ํ๋ฆฌ์ผ์ด์ ๊ธฐ๋ณธ ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด๋ฅผ ์ค์ ํ์ธ์.
์์ธํ ๋ด์ฉ์ ๋ค์์ ์ฐธ์กฐํ์ธ์: Set up authentication for a local development environment.
Node.js
๋ก์ปฌ ๊ฐ๋ฐ ํ๊ฒฝ์์ ์ด ํ์ด์ง์ Node.js ์ํ์ ์ฌ์ฉํ๋ ค๋ฉด gcloud CLI๋ฅผ ์ค์น ๋ฐ ์ด๊ธฐํํ ๋ค์ ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด๋ก ์ ํ๋ฆฌ์ผ์ด์ ๊ธฐ๋ณธ ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด๋ฅผ ์ค์ ํ์ธ์.
์์ธํ ๋ด์ฉ์ ๋ค์์ ์ฐธ์กฐํ์ธ์: Set up authentication for a local development environment.
PHP
๋ก์ปฌ ๊ฐ๋ฐ ํ๊ฒฝ์์ ์ด ํ์ด์ง์ PHP ์ํ์ ์ฌ์ฉํ๋ ค๋ฉด gcloud CLI๋ฅผ ์ค์น ๋ฐ ์ด๊ธฐํํ ๋ค์ ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด๋ก ์ ํ๋ฆฌ์ผ์ด์ ๊ธฐ๋ณธ ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด๋ฅผ ์ค์ ํ์ธ์.
์์ธํ ๋ด์ฉ์ ๋ค์์ ์ฐธ์กฐํ์ธ์: Set up authentication for a local development environment.
Python
๋ก์ปฌ ๊ฐ๋ฐ ํ๊ฒฝ์์ ์ด ํ์ด์ง์ Python ์ํ์ ์ฌ์ฉํ๋ ค๋ฉด gcloud CLI๋ฅผ ์ค์น ๋ฐ ์ด๊ธฐํํ ๋ค์ ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด๋ก ์ ํ๋ฆฌ์ผ์ด์ ๊ธฐ๋ณธ ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด๋ฅผ ์ค์ ํ์ธ์.
์์ธํ ๋ด์ฉ์ ๋ค์์ ์ฐธ์กฐํ์ธ์: Set up authentication for a local development environment.
REST
๋ก์ปฌ ๊ฐ๋ฐ ํ๊ฒฝ์์ ์ด ํ์ด์ง์ REST API ์ํ์ ์ฌ์ฉํ๋ ค๋ฉด gcloud CLI์ ์ ๊ณตํ ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด๋ฅผ ์ฌ์ฉํฉ๋๋ค.
After installing the Google Cloud CLI, initialize it by running the following command:
gcloud init
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
์์ธํ ๋ด์ฉ์ Google Cloud ์ธ์ฆ ๋ฌธ์์ REST ์ฌ์ฉ์ ์ํ ์ธ์ฆ์ ์ฐธ์กฐํ์ธ์.
-
ํ์ํ ์ญํ
์ปดํจํ
์ธ์คํด์ค๋ฅผ ์ค์งํ๊ณ ๋ค์ ์์ํ๋ ๋ฐ ํ์ํ ๊ถํ์ ์ป์ผ๋ ค๋ฉด ๊ด๋ฆฌ์์๊ฒ ํ๋ก์ ํธ์ ๋ํ Compute ์ธ์คํด์ค ๊ด๋ฆฌ์(v1)(roles/compute.instanceAdmin.v1
) IAM ์ญํ ์ ๋ถ์ฌํด ๋ฌ๋ผ๊ณ ์์ฒญํ์ธ์.
์ญํ ๋ถ์ฌ์ ๋ํ ์์ธํ ๋ด์ฉ์ ํ๋ก์ ํธ, ํด๋, ์กฐ์ง์ ๋ํ ์ก์ธ์ค ๊ด๋ฆฌ๋ฅผ ์ฐธ์กฐํ์ธ์.
์ด ์ฌ์ ์ ์๋ ์ญํ ์๋ ์ปดํจํ ์ธ์คํด์ค๋ฅผ ์ค์งํ๊ฑฐ๋ ๋ค์ ์์ํ๋ ๋ฐ ํ์ํ ๊ถํ์ด ํฌํจ๋์ด ์์ต๋๋ค. ํ์ํ ์ ํํ ๊ถํ์ ๋ณด๋ ค๋ฉด ํ์ ๊ถํ ์น์ ์ ํผ์น์ธ์.
ํ์ ๊ถํ
์ปดํจํ ์ธ์คํด์ค๋ฅผ ์ค์งํ๊ฑฐ๋ ๋ค์ ์์ํ๋ ค๋ฉด ๋ค์ ๊ถํ์ด ํ์ํฉ๋๋ค.
-
์ธ์คํด์ค๋ฅผ ์ค์งํ๋ ค๋ฉด: ์ธ์คํด์ค์ ๋ํ
compute.instances.stop
-
๊ฒ์คํธ OS์์ ์ธ์คํด์ค๋ฅผ ์ค์งํ๋ ค๋ฉด: ์ธ์คํด์ค ์์ค ๊ณต๊ฐ SSH ํค๋ฅผ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ ์ธ์คํด์ค์ ๋ํ
compute.instances.setMetadata
-
์ธ์คํด์ค๋ฅผ ๋ค์ ์์ํ๋ ค๋ฉด: ์ธ์คํด์ค์ ๋ํ
compute.instances.start
-
์ํธํ ํค๋ฅผ ์ฌ์ฉํ๋ ์ธ์คํด์ค๋ฅผ ๋ค์ ์์ํ๋ ค๋ฉด: ์ธ์คํด์ค์ ๋ํ
compute.instances.startWithEncryptionKey
์ปค์คํ ์ญํ ์ด๋ ๋ค๋ฅธ ์ฌ์ ์ ์๋ ์ญํ ์ ์ฌ์ฉํ์ฌ ์ด ๊ถํ์ ๋ถ์ฌ๋ฐ์ ์๋ ์์ต๋๋ค.
์ธ์คํด์ค ์ค์ง
์ปดํจํ ์ธ์คํด์ค๋ฅผ ์ค์งํ๊ฑฐ๋ Compute Engine์์ ์์ฝ๋ ์์ ์ ๋ํด ์ค์งํ๋ ๊ฒฝ์ฐ ์ธ์คํด์ค๋ ํด๋น ์ธ์คํด์ค์ ์ฐ๊ฒฐ๋ ๋ฆฌ์์ค, ๊ตฌ์ฑ ์ค์ , ๋ด๋ถ IP ์ฃผ์, MAC ์ฃผ์, ๋ฉํ๋ฐ์ดํฐ๋ฅผ ์ ์งํฉ๋๋ค. ๊ทธ๋ฌ๋ ์ธ์คํด์ค๋ ์ธ๋ฉ๋ชจ๋ฆฌ ๋ฐ์ดํฐ์ ์ ํ๋ฆฌ์ผ์ด์ ์ํ๋ฅผ ์๊ฒ ๋ฉ๋๋ค. ์ด๋ฌํ ์ํ๋ฅผ ์ ์งํด์ผ ํ๋ ๊ฒฝ์ฐ ๋์ ์ธ์คํด์ค๋ฅผ ์ผ์์ค์งํฉ๋๋ค.
์ธ์คํด์ค์ ๋ก์ปฌ SSD ๋์คํฌ๊ฐ ์ฐ๊ฒฐ๋์ด ์๋์ง ์ฌ๋ถ์ ์ข ๋ฃ ์คํฌ๋ฆฝํธ๋ฅผ ์ฒ๋ฆฌํ ๋ฐฉ๋ฒ์ ๋ฐ๋ผ ๋ค์ ๋ฐฉ๋ฒ์ ์ฌ์ฉํ์ฌ ์ธ์คํด์ค๋ฅผ ์ค์งํ ์ ์์ต๋๋ค.
๋ก์ปฌ SSD ๋์คํฌ๊ฐ ์๋ ์ธ์คํด์ค ์ค์ง
๋ก์ปฌ SSD ๋์คํฌ๊ฐ ์ฐ๊ฒฐ๋์ด ์์ง ์์ ํ๋ ์ด์์ ์ธ์คํด์ค๋ฅผ ๋์์ ์ค์งํ ์ ์์ต๋๋ค. ์ธ์คํด์ค์ ๋ชจ๋ ์ข ๋ฃ ์คํฌ๋ฆฝํธ๋ ๊ธฐ๋ณธ ์ข ๋ฃ ๊ธฐ๊ฐ ๋ด์ ์คํ์ ์๋ฃํด์ผ ํฉ๋๋ค.
๋ก์ปฌ SSD ๋์คํฌ๊ฐ ์๋ ์ธ์คํด์ค ์ค์ง
๋ก์ปฌ SSD ๋์คํฌ๊ฐ ์ฐ๊ฒฐ๋ ํ๋ ์ด์์ ์ธ์คํด์ค๋ฅผ ๋์์ ์ค์งํ ๋ ํด๋น ๋์คํฌ์ ๋ฐ์ดํฐ๋ฅผ ์ญ์ ํ๊ฑฐ๋ ๋ณด์กด(ํ๋ฆฌ๋ทฐ)ํ ์ ์์ต๋๋ค. ์ธ์คํด์ค์ ๋ชจ๋ ์ข ๋ฃ ์คํฌ๋ฆฝํธ๋ ๊ธฐ๋ณธ ์ข ๋ฃ ๊ธฐ๊ฐ ๋ด์ ์คํ์ ์๋ฃํด์ผ ํฉ๋๋ค.
๊ฒ์คํธ OS์์ ์ธ์คํด์ค ์ค์ง
์ด ์ ๊ทผ ๋ฐฉ์์ ์ฌ์ฉํ๋ฉด ์ข ๋ฃ ์คํฌ๋ฆฝํธ ์คํ์ด ์๋ฃ๋ ํ์๋ง ๋จ์ผ ์ธ์คํด์ค๋ฅผ ์ค์งํ๊ฑฐ๋, ๋จ๊ณ์ ์ข ๋ฃ๊ฐ ์ฌ์ฉ ์ค์ ๋ ๊ฒฝ์ฐ ๋จ๊ณ์ ์ผ๋ก ์ข ๋ฃํ์ง ์๊ณ ์ธ์คํด์ค๋ฅผ ์ค์งํ๊ฑฐ๋ ์งํ ์ค์ธ ๋จ๊ณ์ ์ข ๋ฃ๋ฅผ ์ข ๋ฃํ ์ ์์ต๋๋ค. ์ฐ๊ฒฐ๋ ๋ก์ปฌ SSD ๋์คํฌ์ ๋ฐ์ดํฐ๋ฅผ ๋ด๊ตฌ์ฑ ์๋ ์คํ ๋ฆฌ์ง ๋ณผ๋ฅจ์ ์๋์ผ๋ก ๋ฐฑ์ ํ์ง ์์ผ๋ฉด ๊ฒ์คํธ OS ๋ด์์ ์ธ์คํด์ค๋ฅผ ์ค์งํ๋ฉด ํด๋น ๋์คํฌ์ ์๋ ๋ฐ์ดํฐ๊ฐ ์ญ์ ๋ฉ๋๋ค.
๋ก์ปฌ SSD ๋์คํฌ๊ฐ ์๋ ์ธ์คํด์ค ์ค์ง
์ธ์คํด์ค๋ฅผ ์ค์งํ ๋ ์ํํ๋ ค๋ ์์ ์ ๋ฐ๋ผ ๋ค์ ์ต์ ์ ์ฌ์ฉํ์ธ์.
์ธ์คํด์ค์์ ๋จ๊ณ์ ์ข ๋ฃ๋ฅผ ์ฌ์ฉ ์ค์ ํ ๊ฒฝ์ฐ Google Cloud ์ฝ์, gcloud CLI ๋๋ REST API๋ฅผ ์ฌ์ฉํ์ฌ ๋จ๊ณ์ ์ข ๋ฃ ์์ด ์ธ์คํด์ค๋ฅผ ์ค๋จํ๊ฑฐ๋ ์งํ ์ค์ธ ๋จ๊ณ์ ์ข ๋ฃ๋ฅผ ํด์ ํ ์ ์์ต๋๋ค.
์ฌ๋ฌ ์ธ์คํด์ค๋ฅผ ๋์์ ์ค์งํ๋ ค๋ฉด Google Cloud ์ฝ์์ ์ฌ์ฉํ๊ฑฐ๋ ๋์ผํ ์์ญ์ ์๋ ์ธ์คํด์ค์ ๊ฒฝ์ฐ gcloud CLI๋ฅผ ์ฌ์ฉํฉ๋๋ค.
ํ๋ ์ด์์ ์ธ์คํด์ค๋ฅผ ์ค์งํ๋ ค๋ฉด ๋ค์ ์ต์ ์ค ํ๋๋ฅผ ์ ํํฉ๋๋ค.
์ฝ์
Google Cloud ์ฝ์์์ VM ์ธ์คํด์ค ํ์ด์ง๋ก ์ด๋ํฉ๋๋ค.
์ค์งํ ์คํ ์ค์ธ ์ธ์คํด์ค๋ฅผ ์ ํํฉ๋๋ค.
์ค์ง๋ฅผ ํด๋ฆญํฉ๋๋ค. ์ค์ง ์ต์ ์ด ์์ผ๋ฉด ์์ ๋๋ณด๊ธฐ > ์ค์ง๋ฅผ ํด๋ฆญํฉ๋๋ค.
๋ํ์์์์ ๋ค์์ ์ํํฉ๋๋ค.
์ ํ์ฌํญ: ์ธ์คํด์ค๋ฅผ ๋จ๊ณ์ ์ผ๋ก ์ข ๋ฃํ์ง ์๊ณ ์ค์งํ๊ฑฐ๋ ์งํ ์ค์ธ ๋จ๊ณ์ ์ข ๋ฃ๋ฅผ ์ข ๋ฃํ๋ ค๋ฉด ๋จ๊ณ์ ์ข ๋ฃ ๊ฑด๋๋ฐ๊ธฐ(ํด๋นํ๋ ๊ฒฝ์ฐ) ์ฒดํฌ๋ฐ์ค๋ฅผ ์ ํํฉ๋๋ค.
์ค์ง๋ฅผ ํด๋ฆญํ์ฌ ํ์ธํฉ๋๋ค.
gcloud
๋์ผํ ์์ญ์์ ํ๋ ์ด์์ ์ธ์คํด์ค๋ฅผ ์ค์งํ๋ ค๋ฉด gcloud compute instances stop
๋ช
๋ น์ด๋ฅผ ์ฌ์ฉํฉ๋๋ค.
gcloud compute instances stop INSTANCE_NAMES \
--zone=ZONE
๋ค์์ ๋ฐ๊ฟ๋๋ค.
INSTANCE_NAMES
: ๊ณต๋ฐฑ์ผ๋ก ๊ตฌ๋ถ๋ ์ธ์คํด์ค ์ด๋ฆ ๋ชฉ๋ก(์:instance-01 instance-02 instance-03
)ZONE
: ์ธ์คํด์ค๊ฐ ์๋ ์์ญ
์ ํ์ ์ผ๋ก ํ๋ ์ด์์ ์ธ์คํด์ค์์ ๋จ๊ณ์ ์ข
๋ฃ๋ฅผ ์ฌ์ฉ ์ค์ ํ ๊ฒฝ์ฐ ์ธ์คํด์ค๋ฅผ ๋จ๊ณ์ ์ผ๋ก ์ข
๋ฃํ์ง ์๊ณ ์ค์งํ๊ฑฐ๋ ์งํ ์ค์ธ ๋จ๊ณ์ ์ข
๋ฃ๋ฅผ ์๋์ผ๋ก ์ข
๋ฃํ ์ ์์ต๋๋ค. ์ด๋ ๊ฒ ํ๋ ค๋ฉด --no-graceful-shutdown
ํ๋๊ทธ์ ํจ๊ป gcloud beta compute instances stop
๋ช
๋ น์ด๋ฅผ ์ฌ์ฉํฉ๋๋ค.
gcloud beta compute instances stop INSTANCE_NAMES \
--no-graceful-shutdown \
--zone=ZONE
Go
์๋ฐ
Node.js
PHP
Python
REST
์ธ์คํด์ค๋ฅผ ์ค์งํ๋ ค๋ฉด POST
์์ฒญ์ instances.stop
๋ฉ์๋์ ๋ณด๋
๋๋ค.
POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/INSTANCE_NAME/stop
๋ค์์ ๋ฐ๊ฟ๋๋ค.
INSTANCE_NAME
: ์ธ์คํด์ค ์ด๋ฆ์ ๋๋ค.PROJECT_ID
: ์ธ์คํด์ค๊ฐ ์๋ ํ๋ก์ ํธ์ ID์ ๋๋ค.ZONE
: ์ธ์คํด์ค๊ฐ ์๋ ์์ญ์ ๋๋ค.
์ ํ์ ์ผ๋ก ์ธ์คํด์ค์์ ๋จ๊ณ์ ์ข
๋ฃ๋ฅผ ์ฌ์ฉ ์ค์ ํ ๊ฒฝ์ฐ ์ธ์คํด์ค๋ฅผ ๋จ๊ณ์ ์ผ๋ก ์ข
๋ฃํ์ง ์๊ณ ์ค์งํ๊ฑฐ๋ ์งํ ์ค์ธ ๋จ๊ณ์ ์ข
๋ฃ๋ฅผ ์๋์ผ๋ก ์ข
๋ฃํ ์ ์์ต๋๋ค. ์ด๋ ๊ฒ ํ๋ ค๋ฉด POST
์์ฒญ์ instances.stop
๋ฉ์๋์ ์คํํฉ๋๋ค.
์์ฒญ URL์ noGracefulShutdown=true
์ฟผ๋ฆฌ ํ๋ผ๋ฏธํฐ๋ฅผ ํฌํจํฉ๋๋ค.
POST https://compute.googleapis.com/compute/beta/projects/PROJECT_ID/zones/ZONE/instances/VM_NAME/stop?noGracefulShutdown=true
๋ก์ปฌ SSD ๋์คํฌ๊ฐ ์๋ ์ธ์คํด์ค ์ค์ง
์ปดํจํ ์ธ์คํด์ค๋ฅผ ์ค์งํ ๋ ์ํํ๋ ค๋ ์์ ์ ๋ฐ๋ผ ๋ค์ ์ต์ ์ ์ฌ์ฉํฉ๋๋ค.
์ธ์คํด์ค์์ ๋จ๊ณ์ ์ข ๋ฃ๋ฅผ ์ฌ์ฉ ์ค์ ํ ๊ฒฝ์ฐ Google Cloud ์ฝ์, gcloud CLI ๋๋ REST API๋ฅผ ์ฌ์ฉํ์ฌ ๋จ๊ณ์ ์ข ๋ฃ ์์ด ์ธ์คํด์ค๋ฅผ ์ค๋จํ๊ฑฐ๋ ์งํ ์ค์ธ ๋จ๊ณ์ ์ข ๋ฃ๋ฅผ ํด์ ํ ์ ์์ต๋๋ค.
์ธ์คํด์ค์ ์ฐ๊ฒฐ๋ ๋ก์ปฌ SSD ๋์คํฌ์ ๋ฐ์ดํฐ๋ฅผ ๋ณด์กดํ๋ ค๋ฉด(ํฐํ๋ SSD๋ฅผ ์ฌ์ฉํ๋ ๋จธ์ ์ ํ ์ ์ธ) gcloud CLI ๋๋ REST API๋ฅผ ์ฌ์ฉํ์ฌ ์ธ์คํด์ค๋ฅผ ์ค์งํฉ๋๋ค.
์ฌ๋ฌ ์ธ์คํด์ค๋ฅผ ๋์์ ์ค์งํ๋ ค๋ฉด Google Cloud ์ฝ์์ ์ฌ์ฉํ๊ฑฐ๋ ๋์ผํ ์์ญ์ ์๋ ์ธ์คํด์ค์ ๊ฒฝ์ฐ gcloud CLI๋ฅผ ์ฌ์ฉํฉ๋๋ค.
๋ก์ปฌ SSD ๋์คํฌ๊ฐ ์ฐ๊ฒฐ๋ ํ๋ ์ด์์ ์ธ์คํด์ค๋ฅผ ์ค์งํ๋ ค๋ฉด ๋ค์ ์ต์ ์ค ํ๋๋ฅผ ์ ํํฉ๋๋ค.
์ฝ์
Google Cloud ์ฝ์์์ VM ์ธ์คํด์ค ํ์ด์ง๋ก ์ด๋ํฉ๋๋ค.
์ค์งํ ์คํ ์ค์ธ ์ธ์คํด์ค๋ฅผ ์ ํํฉ๋๋ค.
์ค์ง๋ฅผ ํด๋ฆญํฉ๋๋ค. ์ค์ง ์ต์ ์ด ์์ผ๋ฉด ์์ ๋๋ณด๊ธฐ > ์ค์ง๋ฅผ ํด๋ฆญํฉ๋๋ค.
๋ํ์์์์ ๋ค์์ ์ํํฉ๋๋ค.
์ ํ์ฌํญ: ์ธ์คํด์ค๋ฅผ ๋จ๊ณ์ ์ผ๋ก ์ข ๋ฃํ์ง ์๊ณ ์ค์งํ๊ฑฐ๋ ์งํ ์ค์ธ ๋จ๊ณ์ ์ข ๋ฃ๋ฅผ ์ข ๋ฃํ๋ ค๋ฉด ๋จ๊ณ์ ์ข ๋ฃ ๊ฑด๋๋ฐ๊ธฐ(ํด๋นํ๋ ๊ฒฝ์ฐ) ์ฒดํฌ๋ฐ์ค๋ฅผ ์ ํํฉ๋๋ค.
์ค์ง๋ฅผ ํด๋ฆญํ์ฌ ํ์ธํฉ๋๋ค.
gcloud
๋ก์ปฌ SSD ๋์คํฌ๊ฐ ์ฐ๊ฒฐ๋ ๋์ผํ ์์ญ์์ ํ๋ ์ด์์ ์ธ์คํด์ค๋ฅผ ์ค์งํ ๋๋ ๋ก์ปฌ SSD ๋ฐ์ดํฐ๋ฅผ ์ญ์ ํ๊ฑฐ๋ ๋ณด์กดํ ์ง ์ฌ๋ถ๋ฅผ ๋ค์๊ณผ ๊ฐ์ด ์ง์ ํฉ๋๋ค.
๋ก์ปฌ SSD ๋ฐ์ดํฐ๋ฅผ ์ญ์ ํ๋ ค๋ฉด
--discard-local-ssd=true
ํ๋๊ทธ์ ํจ๊ปgcloud compute instances stop
๋ช ๋ น์ด๋ฅผ ์ฌ์ฉํฉ๋๋ค.gcloud compute instances stop INSTANCE_NAMES \ --discard-local-ssd=true \ --zone=ZONE
๋ก์ปฌ SSD ๋ฐ์ดํฐ๋ฅผ ๋ณด์กดํ๋ ค๋ฉด
--discard-local-ssd=false
ํ๋๊ทธ์ ํจ๊ปgcloud beta compute instances stop
๋ช ๋ น์ด๋ฅผ ์ฌ์ฉํฉ๋๋ค.gcloud beta compute instances stop INSTANCE_NAMES \ --discard-local-ssd=false \ --zone=ZONE
๋ค์์ ๋ฐ๊ฟ๋๋ค.
INSTANCE_NAMES
: ๊ณต๋ฐฑ์ผ๋ก ๊ตฌ๋ถ๋ ์ธ์คํด์ค ์ด๋ฆ ๋ชฉ๋ก(์:instance-01 instance-02 instance-03
)ZONE
: ์ธ์คํด์ค๊ฐ ์๋ ์์ญ
์ ํ์ ์ผ๋ก ํ๋ ์ด์์ ์ธ์คํด์ค์์ ๋จ๊ณ์ ์ข
๋ฃ๋ฅผ ์ฌ์ฉ ์ค์ ํ ๊ฒฝ์ฐ ์ธ์คํด์ค๋ฅผ ๋จ๊ณ์ ์ผ๋ก ์ข
๋ฃํ์ง ์๊ณ ์ค์งํ๊ฑฐ๋ ์งํ ์ค์ธ ๋จ๊ณ์ ์ข
๋ฃ๋ฅผ ์ข
๋ฃํ ์ ์์ต๋๋ค. ์ด๋ ๊ฒ ํ๋ ค๋ฉด --no-graceful-shutdown
ํ๋๊ทธ์ ํจ๊ป gcloud beta compute instances stop
๋ช
๋ น์ด๋ฅผ ์ฌ์ฉํฉ๋๋ค.
gcloud beta compute instances stop INSTANCE_NAMES \
--discard-local-ssd=DISCARD_LOCAL_SSD \
--no-graceful-shutdown \
--zone=ZONE
DISCARD_LOCAL_SSD
๋ฅผ true
๋ก ๋ฐ๊ฟ ๋ก์ปฌ SSD ๋์คํฌ์ ๋ฐ์ดํฐ๋ฅผ ์ญ์ ํ๊ฑฐ๋ false
๋ก ๋ฐ๊ฟ ๋ฐ์ดํฐ๋ฅผ ๋ณด์กดํฉ๋๋ค.
REST
๋ก์ปฌ SSD ๋์คํฌ๊ฐ ์ฐ๊ฒฐ๋ ์ธ์คํด์ค๋ฅผ ์ค์งํ ๋ ๋ค์๊ณผ ๊ฐ์ด ๋ก์ปฌ SSD ๋ฐ์ดํฐ๋ฅผ ์ญ์ ํ ์ง ๋๋ ๋ณด์กดํ ์ง ์ฌ๋ถ๋ฅผ ์ง์ ํฉ๋๋ค.
๋ก์ปฌ SSD ๋ฐ์ดํฐ๋ฅผ ์ญ์ ํ๋ ค๋ฉด
POST
์์ฒญ์instances.stop
๋ฉ์๋์ ๋ณด๋ ๋๋ค. ์์ฒญ URL์true
๋ก ์ค์ ๋discardLocalSsd
์ฟผ๋ฆฌ ๋งค๊ฐ๋ณ์๋ฅผ ํฌํจํฉ๋๋ค.POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/INSTANCE_NAME/stop?discardLocalSsd=true
๋ก์ปฌ SSD ๋ฐ์ดํฐ๋ฅผ ๋ณด์กดํ๋ ค๋ฉด
POST
์์ฒญ์beta.instances.stop
๋ฉ์๋์ ๋ณด๋ ๋๋ค. ์์ฒญ URL์false
๋ก ์ค์ ๋discardLocalSsd
์ฟผ๋ฆฌ ๋งค๊ฐ๋ณ์๋ฅผ ํฌํจํฉ๋๋ค.POST https://compute.googleapis.com/compute/beta/projects/PROJECT_ID/zones/ZONE/instances/INSTANCE_NAME/stop?discardLocalSsd=false
๋ค์์ ๋ฐ๊ฟ๋๋ค.
PROJECT_ID
: ์ธ์คํด์ค๊ฐ ์๋ ํ๋ก์ ํธ์ ID์ ๋๋ค.ZONE
: ์ธ์คํด์ค๊ฐ ์๋ ์์ญ์ ๋๋ค.INSTANCE_NAME
: ์ธ์คํด์ค ์ด๋ฆ์ ๋๋ค.
์ ํ์ ์ผ๋ก ์ธ์คํด์ค์์ ๋จ๊ณ์ ์ข
๋ฃ๋ฅผ ์ฌ์ฉ ์ค์ ํ ๊ฒฝ์ฐ ๋จ๊ณ์ ์ผ๋ก ์ข
๋ฃํ์ง ์๊ณ ์ธ์คํด์ค๋ฅผ ์ค์งํ๊ฑฐ๋ ์งํ ์ค์ธ ๋จ๊ณ์ ์ข
๋ฃ๋ฅผ ์๋์ผ๋ก ์ข
๋ฃํ ์ ์์ต๋๋ค. ์ด๋ ๊ฒ ํ๋ ค๋ฉด POST
์์ฒญ์ instances.stop
๋ฉ์๋์ ์คํํฉ๋๋ค.
์์ฒญ URL์ noGracefulShutdown=true
์ฟผ๋ฆฌ ํ๋ผ๋ฏธํฐ๋ฅผ ํฌํจํฉ๋๋ค.
POST https://compute.googleapis.com/compute/beta/projects/PROJECT_ID/zones/ZONE/instances/VM_NAME/stop?discardLocalSsd=DISCARD_LOCAL_SSD&noGracefulShutdown=true
DISCARD_LOCAL_SSD
๋ฅผ true
๋ก ๋ฐ๊ฟ ๋ก์ปฌ SSD ๋์คํฌ์ ๋ฐ์ดํฐ๋ฅผ ์ญ์ ํ๊ฑฐ๋ false
๋ก ๋ฐ๊ฟ ๋ฐ์ดํฐ๋ฅผ ๋ณด์กดํฉ๋๋ค.
๊ฒ์คํธ OS์์ ์ธ์คํด์ค ์ค์ง
์ปดํจํ ์ธ์คํด์ค์ ๋ก์ปฌ SSD ๋์คํฌ๊ฐ ์ฐ๊ฒฐ๋ ๊ฒฝ์ฐ ๊ฒ์คํธ OS๋ฅผ ์ข ๋ฃํ๋ฉด ๋ก์ปฌ SSD ๋ฐ์ดํฐ๊ฐ ์๋์ผ๋ก ์ญ์ ๋ฉ๋๋ค. ์ด ๋ฐ์ดํฐ๋ฅผ ๋ณด์กดํ๋ ค๋ฉด ์ธ์คํด์ค๋ฅผ ์ค์งํ๊ธฐ ์ ์ ๋ฐ์ดํฐ๋ฅผ ์๊ตฌ ์ ์ฅ์ ์ต์ ์ ์๋์ผ๋ก ๋ณต์ฌํฉ๋๋ค.
๊ฒ์คํธ OS์์ ์ธ์คํด์ค๋ฅผ ์ค์งํ๋ ค๋ฉด ๋ค์ ์ต์ ์ค ํ๋๋ฅผ ์ ํํฉ๋๋ค.
Linux
์์ง ์ฐ๊ฒฐํ์ง ์์๋ค๋ฉด ์ธ์คํด์ค์ ์ฐ๊ฒฐํฉ๋๋ค.
์ธ์คํด์ค๋ฅผ ์ค์งํ๋ ค๋ฉด ๋ค์ ๋ฐฉ๋ฒ ์ค ํ๋๋ฅผ ์ ํํฉ๋๋ค.
๊ฒ์คํธ OS๋ฅผ ์ข ๋ฃํ๊ธฐ ์ ์ ์ธ์คํด์ค์์ ์ข ๋ฃ ์คํฌ๋ฆฝํธ๋ฅผ ์คํํ ์ ์๋๋ก ํ์ฉํ๋ ์์ ์ข ๋ฃ์ ๊ฒฝ์ฐ ๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํฉ๋๋ค.
sudo shutdown -h now
๊ทธ๋ ์ง ์์ ๊ฒฝ์ฐ ๊ฐ์ ์ข ๋ฃํ๋ ค๋ฉด ๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํฉ๋๋ค.
sudo poweroff
Windows
์์ง ์ฐ๊ฒฐํ์ง ์์๋ค๋ฉด ๋ค์ ๋ฐฉ๋ฒ ์ค ํ๋๋ฅผ ์ฌ์ฉํ์ฌ ์ธ์คํด์ค์ ์ฐ๊ฒฐํฉ๋๋ค.
์ธ์คํด์ค๋ฅผ ์ค์งํ๋ ค๋ฉด ๋ค์ ๋ฐฉ๋ฒ ์ค ํ๋๋ฅผ ์ ํํฉ๋๋ค.
์ธ์คํด์ค๋ฅผ ์์ ํ ์ค์งํ๊ณ ๊ฒ์คํธ OS๋ฅผ ์ข ๋ฃํ๊ธฐ ์ ์ ์ธ์คํด์ค์์ ์ข ๋ฃ ์คํฌ๋ฆฝํธ๋ฅผ ์คํํ๋๋ก ํ๋ ค๋ฉด ๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํฉ๋๋ค.
shutdown /s
๊ฐ์ ์ข ๋ฃํ๋ ค๋ฉด ๋ค์ ๋ช ๋ น์ด๋ฅผ ์คํํฉ๋๋ค.
shutdown /f
์ธ์คํด์ค ๋ค์ ์์
์ธ์คํด์ค ์ํ๊ฐ TERMINATED
์ธ ์์ ํ ์ค์ง๋ ์ปดํจํ
์ธ์คํด์ค๋ฅผ ๋ค์ ์์ํ ์ ์์ต๋๋ค.
์ธ์คํด์ค๋ฅผ ์ค์งํ ๋ ๋ก์ปฌ SSD ๋์คํฌ์ ๋ฐ์ดํฐ๋ฅผ ๋ณด์กดํ๋๋ก ์ ํํ ๊ฒฝ์ฐ ์ธ์คํด์ค๋ฅผ ๋ค์ ์์ํ ํ ๋ก์ปฌ SSD ๋์คํฌ๋ฅผ ๋ค์ ๋ง์ดํธํด์ผ ํ ์ ์์ต๋๋ค. ๋ก์ปฌ SSD ๋์คํฌ๋ฅผ ๋ง์ดํธํ๋ ๋ฐฉ๋ฒ์ ๊ดํ ์์ธํ ๋ด์ฉ์ ๋ก์ปฌ SSD ๊ธฐ๊ธฐ ํฌ๋งท ๋ฐ ๋ง์ดํธ๋ฅผ ์ฐธ๊ณ ํ์ธ์.
์ธ์คํด์ค๋ฅผ ๋ค์ ์์ํ๋ ค๋ฉด ์ธ์คํด์ค์ ์ํธํ๋ ๋์คํฌ๊ฐ ์ฐ๊ฒฐ๋์๋์ง ์ฌ๋ถ์ ๋ฐ๋ผ ๋ค์ ๋ฐฉ๋ฒ ์ค ํ๋๋ฅผ ์ฌ์ฉํ์ธ์.
์ธ์คํด์ค์ ์ํธํ๋ ๋์คํฌ๊ฐ ์ฐ๊ฒฐ๋์ด ์์ง ์์ผ๋ฉด ์ํธํ๋ ๋์คํฌ๊ฐ ์๋ ์ธ์คํด์ค ๋ค์ ์์์ ์ฐธ๊ณ ํ์ธ์.
๊ทธ๋ ์ง ์์ ๊ฒฝ์ฐ ์ํธํ๋ ๋์คํฌ๋ก ์ธ์คํด์ค ๋ค์ ์์์ ์ฐธ๊ณ ํ์ธ์.
์ํธํ๋ ๋์คํฌ๊ฐ ์๋ ์ธ์คํด์ค ๋ค์ ์์
์ฌ๋ฌ ์ปดํจํ ์ธ์คํด์ค๋ฅผ ๋์์ ๋ค์ ์์ํ๊ฑฐ๋ ๊ฐ๋ณ ์ธ์คํด์ค๋ฅผ ๋ค์ ์์ํ ์ ์์ต๋๋ค. ์ฌ๋ฌ ์ธ์คํด์ค์ ๊ฒฝ์ฐ Google Cloud ์ฝ์์ ์ฌ์ฉํ๊ณ ๋์ผ ์์ญ์ ์๋ ์ธ์คํด์ค์ ๊ฒฝ์ฐ gcloud CLI๋ฅผ ์ฌ์ฉํฉ๋๋ค. ๊ฐ๋ณ ์ธ์คํด์ค์ ๊ฒฝ์ฐ ๋ค์ ์ต์ ์ ์ ํํฉ๋๋ค.
์ฝ์
Google Cloud ์ฝ์์์ VM ์ธ์คํด์ค ํ์ด์ง๋ก ์ด๋ํฉ๋๋ค.
์ธ์คํด์ค๋ฅผ ํ๋ ์ด์ ์ ํํฉ๋๋ค.
์์/์ฌ๊ฐ๋ฅผ ํด๋ฆญํฉ๋๋ค.
gcloud
๋์ผํ ์์ญ์์ ํ๋ ์ด์์ ์ธ์คํด์ค๋ฅผ ๋ค์ ์์ํ๋ ค๋ฉด gcloud compute instances start
๋ช
๋ น์ด๋ฅผ ์ฌ์ฉํฉ๋๋ค.
gcloud compute instances start INSTANCE_NAMES \
--zone=ZONE
๋ค์์ ๋ฐ๊ฟ๋๋ค.
INSTANCE_NAMES
: ๊ณต๋ฐฑ์ผ๋ก ๊ตฌ๋ถ๋ ์ธ์คํด์ค ์ด๋ฆ ๋ชฉ๋ก(์:instance-01 instance-02 instance-03
)ZONE
: ์ธ์คํด์ค๊ฐ ์๋ ์์ญ
Go
์๋ฐ
Node.js
PHP
Python
REST
์ธ์คํด์ค๋ฅผ ๋ค์ ์์ํ๋ ค๋ฉด POST
์์ฒญ์ instances.start
๋ฉ์๋์ ๋ณด๋
๋๋ค.
POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/INSTANCE_NAME/start
๋ค์์ ๋ฐ๊ฟ๋๋ค.
INSTANCE_NAME
: ๋ค์ ์์ํ ์ธ์คํด์ค์ ์ด๋ฆ์ ๋๋ค.PROJECT_ID
: ์ธ์คํด์ค๊ฐ ์๋ ํ๋ก์ ํธ์ ID์ ๋๋ค.ZONE
: ์ธ์คํด์ค๊ฐ ์๋ ์์ญ์ ๋๋ค.
์ํธํ๋ ๋์คํฌ๋ก ์ธ์คํด์ค ๋ค์ ์์
๊ณ ๊ฐ ์ ๊ณต ์ํธํ ํค๋ฅผ ์ฌ์ฉํ์ฌ ์ํธํ๋ ๋์คํฌ๊ฐ ์ฐ๊ฒฐ๋ ์ค์ง๋ ์ปดํจํ ์ธ์คํด์ค๋ฅผ ๋ค์ ์์ํ ๋๋ ์ํธํ ํค ์ ๋ณด๋ฅผ ์ ๊ณตํด์ผ ํฉ๋๋ค.
์ฌ๋ฌ ์ธ์คํด์ค๋ฅผ ๋์์ ๋ค์ ์์ํ๊ฑฐ๋ ๊ฐ๋ณ ์ธ์คํด์ค๋ฅผ ๋ค์ ์์ํ ์ ์์ต๋๋ค. ์ฌ๋ฌ ์ธ์คํด์ค์ ๊ฒฝ์ฐ Google Cloud ์ฝ์์ ์ฌ์ฉํ๊ณ ๋์ผ ์์ญ์ ์๋ ์ธ์คํด์ค์ ๊ฒฝ์ฐ gcloud CLI๋ฅผ ์ฌ์ฉํฉ๋๋ค. ๊ฐ๋ณ ์ธ์คํด์ค์ ๊ฒฝ์ฐ ๋ค์ ์ต์ ์ ์ ํํฉ๋๋ค.
์ฝ์
Google Cloud ์ฝ์์์ VM ์ธ์คํด์ค ํ์ด์ง๋ก ์ด๋ํฉ๋๋ค.
๋ค์ ์์ํ ์ธ์คํด์ค๋ฅผ ์ ํํฉ๋๋ค.
์์/์ฌ๊ฐ๋ฅผ ํด๋ฆญํฉ๋๋ค.
์ธ์คํด์ค์ ์ฐ๊ฒฐ๋ ๊ฐ ์ํธํ๋ ๋์คํฌ์ ๋ํ ์ํธํ ํค๋ฅผ ์ง์ ํ ๋ค์ ์์์ ํด๋ฆญํฉ๋๋ค.
gcloud
๋์ผํ ์์ญ์์ ์ํธํ๋ ๋์คํฌ๋ฅผ ์ฌ์ฉํ๋ ํ๋ ์ด์์ ์ธ์คํด์ค๋ฅผ ๋ค์ ์์ํ๋ ค๋ฉด --csek-key-file
ํ๋๊ทธ์ ํจ๊ป gcloud compute instances start
๋ช
๋ น์ด๋ฅผ ์ฌ์ฉํฉ๋๋ค. RSA ๋ํ ํค๋ฅผ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ --csek-key-file
ํ๋๊ทธ์ ํจ๊ป gcloud beta compute instances start
๋ช
๋ น์ด๋ฅผ ๋์ ์ฌ์ฉํฉ๋๋ค.
gcloud compute instances start INSTANCE_NAMES \
--csek-key-file=ENCRYPTION_KEY_FILE \
--zone=ZONE
๋ค์์ ๋ฐ๊ฟ๋๋ค.
INSTANCE_NAMES
: ๊ณต๋ฐฑ์ผ๋ก ๊ตฌ๋ถ๋ ์ธ์คํด์ค ์ด๋ฆ ๋ชฉ๋ก(์:instance-01 instance-02 instance-03
)ENCRYPTION_KEY_FILE
: ๊ณ ๊ฐ ์ ๊ณต ์ํธํ ํค๊ฐ ํฌํจ๋ JSON ํ์ผ์ ์๋ ๊ฒฝ๋ก์ ๋๋ค. ์ธ์คํด์ค๊ฐ ๋์ผํ ๊ณ ๊ฐ ์ ๊ณต ์ํธํ ํค๋ฅผ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ์๋ง ์ฌ๋ฌ ์ธ์คํด์ค๋ฅผ ๋์์ ๋ค์ ์์ํ ์ ์์ต๋๋ค.ZONE
: ์ธ์คํด์ค๊ฐ ์๋ ์์ญ
Go
์๋ฐ
Node.js
PHP
Python
REST
์ํธํ๋ ๋์คํฌ๋ฅผ ์ฌ์ฉํ๋ ์ธ์คํด์ค๋ฅผ ๋ค์ ์์ํ๋ ค๋ฉด instances.startWithEncryptionKey
๋ฉ์๋์ POST
์์ฒญ์ ๋ณด๋
๋๋ค.
POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/INSTANCE_NAME/startWithEncryptionKey
{
"disks": [
{
"source": "DISK_URL",
"diskEncryptionKey": {
"ENCRYPTION_TYPE": "ENCRYPTION_KEY"
}
}
]
}
๋ค์์ ๋ฐ๊ฟ๋๋ค.
PROJECT_ID
: ์ธ์คํด์ค๊ฐ ์๋ ํ๋ก์ ํธ์ ID์ ๋๋ค.ZONE
: ์ธ์คํด์ค๊ฐ ์๋ ์์ญ์ ๋๋ค.INSTANCE_NAME
: ์ธ์คํด์ค ์ด๋ฆ์ ๋๋ค.DISK_URL
: ๊ณ ๊ฐ ์ ๊ณต ์ํธํ ํค๋ก ์ํธํ๋ ์ฐ๊ฒฐ ๋์คํฌ์ ์ ์ฒด ๋ฆฌ์์ค ์ด๋ฆ์ ํด๋นํ๋ ๋ฆฌ์์ค URL์ ๋๋ค.ENCRYPTION_TYPE
: ์ฌ์ฉ ์ค์ธ ๋์คํฌ ์ํธํ ์ ํ์ด๋ฉฐ ๋ค์rawKey
,kmsKeyName
,rsaEncryptedKey
์ค ํ๋์ผ ์ ์์ต๋๋ค.rsaEncryptedKey
์ ํ์ ์ฌ์ฉํ๋ ๊ฒฝ์ฐbeta.instances.startWithEncryptionKey
๋ฉ์๋์POST
์์ฒญ์ ์ํํฉ๋๋ค.ENCRYPTION_KEY
: ์ธ์คํด์ค์ ์ฐ๊ฒฐ๋ ์๊ตฌ ๋์คํฌ๋ฅผ ์ํธํํ๋ ๋ฐ ์ฌ์ฉ๋๋ ์ํธํ ํค์ ๋๋ค.rawKey
๋๋rsaEncryptedKey
ํค๋ base64๋ก ์ธ์ฝ๋ฉ๋์ด์ผ ํฉ๋๋ค. ๋ํrsaEncryptedKey
ํค๋ฅผ ์ค๋นํ๋ ค๋ฉด RSA ํค ๋ํ์ ์ฐธ๊ณ ํ์ธ์.