Extend Volume 操作 - 每天5分鐘玩轉 OpenStack(56)

來源:互聯網
上載者:User

標籤:

前面我們討論了 volume 的 attach 和 detach 操作,今天討論如何擴大 volume 的容量。為了保護現有資料,cinder 不允許縮小 volume。

Extend 操作用於擴大 Volume 的容量,狀態為 Available 的 volume 才能夠被 extend。如果 volume 當前已經 attach 給 instance,需要先 detach 後才能 extend。

Extend 實現比較簡單,流程圖如下:

  1. 向 cinder-api 發送 extend 請求

  2. cinder-api 發送訊息

  3. cinder-volume 執行 extend 操作

下面我們詳細討論每一個步驟。

向 cinder-api 發送 extend 請求

客戶(可以是 OpenStack 終端使用者,也可以是其他程式)向 cinder-api 發送請求:“請 extend 指定的 volume。

這裡我們將 extend volume “vol-2”。

進入 GUI 操作菜單 Project -> Compute -> Volumes。

vol-2 當前大小為 1GB。其在儲存節點上對應的 LV 資訊如下:

選擇 volume “vol-2”,點擊 “Extend Volume”。

指定新的容量為 3GB,點擊 “Extend Volume”。

cinder-api 將接收到 extend volume 的請求。記錄檔在 /opt/stack/logs/c-api.log。

cinder-api 發送訊息

cinder-api 發送訊息 extend 訊息。cinder-api 沒有列印發送訊息的日誌,只能通過原始碼查看。/opt/stack/cinder/cinder/volume/api.py,方法為 extend。

cinder-volume extend volume

cinder-volume 執行 lvextend 命令 extend volume。 日誌為 /opt/stack/logs/c-vol.log

LV 被 extend 到 3GB。

Extend 操作完成後,GUI 也會更新 volume 的狀態資訊。

以上就是 extend volume 的分析,下一節我們討論 delete 操作。

 


Extend Volume 操作 - 每天5分鐘玩轉 OpenStack(56)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.