跳到主要內容

GCE上製作自己的image

在雲端的世代,主機服務怎麼可以少得了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



步驟三:將image加到Google的image collection中,之後就可以在web console中看到自己的image了喲∼

$ 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拉∼



參考文件:

留言

這個網誌中的熱門文章

透過Google Apps Script結合Google Form做即時郵件通知

體驗過Google Apps Script的功能後,也發現他結合GmailApps的模組 GmailApps的應用可以用在表單填寫完成後,做發信的通知 例如您開立了一個訂購的表單,為了要在第一時間通知商家有訂單進入 就可以直接呼叫Gmail做發信的通知,讓手持Smart Phone的我們可以很快的知道生意上門了! 下面規劃三個function,其中: onCommit():為form commit時候觸發的function,需要掛載於form commit trigger上 jsonArrToTable():目的將json array解析成為一個Table getLastRowTable():目的將整個table的回傳過濾為剩下第一筆(表頭,含有Form的欄位說明)與最後一筆(原則上就是剛剛送出的那一筆表單) 完整程式碼如下: function onCommit(){   var sheet = SpreadsheetApp.getActiveSheet();   var rows = sheet.getDataRange();   var numRows = rows.getNumRows();   var values = rows.getValues();   var content = getLastRowTable(values);   var htmlBody = "Hi Admin: <br/><br/>有訂單拉,檢查一下吧! <br/><br/>" + content + '<br/><br/>Send by Google Apps';   GmailApp.sendEmail(     " your-email-address@gmail.com ",      "Order Confirm Notice",      htmlBody,      {from: ' from-email-...

Share a chrome plugin for manage google cloud platform

好玩意兒報報.... 同事的新作,把Google Project List在Chrome Plugin中! 對一次管理多個專案的人來說,真得超方便的拉! 下載: https://chrome.google.com/webstore/detail/gdclauncher/bicgkglnnilldakpenngnblekooejnpg 使用說明: 1. Use browser url bar to quick search: Type "gdcl" in browser Press "TAB" to start search Type the project id key word then select the search result... 2. Using quick launch bar... You can search by keyword or click project name to go to the project or gae link to go to gae or go to billing page....

Cloud Monitor嚐鮮

GCP上,我們非常想要的一個功能,終於問世.... Cloud Monitor來了!