在雲端的世代,主機服務怎麼可以少得了image呢...
Google Compute Engine在製作image的部分
可以透過幾個簡單的指令來打包你的主機
然後再註冊到image服務上,就可以方便之後使用拉∼
簡單的三步驟,介紹一下:
步驟一:在客製好(安裝好你所需要的軟件或服務)的主機上做打包的動作
$ sudo gcimagebundle -d /dev/sda -o /tmp/ --log_file=/tmp/abc.log
步驟二:傳送到google cloud storage
$ gsutil cp /tmp/308...439.image.tar.gz gs://arecord-customise-images
如果要從google的主機上執行gsutil的話,記得要在開主機的時候,把project access的cloud storage部分選擇read + write
$ gcutil addimage test-image gs://arecord-customise-images/308...439.image.tar.gz
INFO: Waiting for insert of image test-image. Sleeping for 3s.
…(skip)
INFO: Waiting for insert of image test-image. Sleeping for 3s.
INFO: Waiting for insert of image test-image. Sleeping for 3s.
Table of resources:
+------------+-------------+--------+
| name | deprecation | status |
+------------+-------------+--------+
| test-image | | READY |
+------------+-------------+--------+
Table of operations:
+------------------------------------------------+--------+----------------+
| name | status | operation-type |
+------------------------------------------------+--------+----------------+
| operation-1389256440571-4ef8578a13be1-154df2ef | DONE | insert |
+------------------------------------------------+--------+----------------+
接著,你就可以在web console上看到你的image拉∼
參考文件:
- Create Customise Image:https://developers.google.com/compute/docs/images#installinganimage
留言
張貼留言