修改位于Google Cloud Launcher

时间:2018-02-02 00:18:22

标签: google-cloud-platform google-compute-engine google-cloud-launcher

是否有人能够编辑驻留在Cloud Launcher中的图像?

我正在尝试编辑CIS Ubuntu映像,以添加一些像您通常会在计算引擎的图像部分中利用的服务。

我需要在使用以下命令部署映像之前修改一些设置: gcloud beta compute instances create

非常感谢任何想法或反馈。

干杯

1 个答案:

答案 0 :(得分:0)

Yes this is possible by first launching the required image via Cloud Launcher, making the modifications you require, and then saving the modified machines disk as an image. If you wished, you could then delete the original machine you launched via Cloud Launcher, and launch the image you created with the gcloud beta compute instances create.

Here are some step by step instructions.

1) Launch CIS Ubuntu via Cloud Launcher.

2) SSH into the machine and make any modifications you desire.

3) Save the modified disk as an image. To do this navigate to 'Compute Engine' > 'Images' > 'Create Image' and select the boot disk of the CIS Ubuntu instance as the 'Source Disk'. Hit 'Create'.

4) Delete the original machine you launched via the Cloud Launcher

You now have a modified image of the CIS Ubuntu image saved in your project.

You can use this image in conjunction with gcloud beta compute instances create to create a new instance that uses the modified image as the source disk. For example, if you named the image you created in step 3 'cis-image', you could run:

gcloud beta compute instances create mynewinstance --image=cis-image --zone=us-east1-b

Also, if you're not making use of any beta features, you could just use the standard gcloud compute instances create (see here) command instead, for example:

gcloud compute instances create mynewinstance --image=cis-image --zone=us-east1-b

Which ever you choose, this will launch the machine with your modified image.