cinder glusterfs driver代碼結構

來源:互聯網
上載者:User

標籤:cinder volume glusterfs

glusterfs.py檔案

cinder/volume/drivers/glusterfs.py就是cinder調用glusterfs的驅動了

glusterfs.py只有一個GlusterfsDriver class,如所示

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/74/0F/wKiom1YRPUnRLaXiAAFusJ8X2_k557.jpg" title="C70E0FD5-B930-491C-BDC1-4A37DBA77ADF.png" alt="wKiom1YRPUnRLaXiAAFusJ8X2_k557.jpg" />


from os_brick.remotefs import remotefs as remotefs_brick # client端操作from oslo_concurrency import processutilsfrom oslo_config import cfgfrom oslo_log import log as loggingfrom oslo_utils import fileutilsfrom oslo_utils import unitsfrom cinder import exceptionfrom cinder.i18n import _, _LE, _LI, _LWfrom cinder.image import image_utilsfrom cinder import utilsfrom cinder.volume import driver   # 很多定義的方法還沒具體實現from cinder.volume.drivers import remotefs as remotefs_drv  # 基類class GlusterfsDriver(remotefs_drv.RemoteFSSnapDriver, driver.CloneableVD,                      driver.ExtendVD):    """Gluster based cinder driver.    Creates file on Gluster share for using it as block device on hypervisor.    Operations such as create/delete/extend volume/snapshot use locking on a    per-process basis to prevent multiple threads from modifying qcow2 chains    or the snapshot .info file simultaneously.    """

class GlusterfsDriver的父類remotefs_drv.RemoteFSSnapDriver(主要看這個)


cinder/volume/drivers/remotefs.py有兩個class,類RemoteFSSnapDriver從類RemoteFSDriver繼承

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/74/10/wKiom1YRSxLAGSJYAAAqbeKufEQ015.jpg" title="4D5BB04F-1165-4103-8DBE-1DE43A801D4F.png" alt="wKiom1YRSxLAGSJYAAAqbeKufEQ015.jpg" />

class RemoteFSSnapDriver(RemoteFSDriver, driver.SnapshotVD):    """Base class for remotefs drivers implementing qcow2 snapshots.       Driver must implement:         _local_volume_dir(self, volume)    """


650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/74/0D/wKioL1YRTOvyPUPWAAHrZK3EBnI775.jpg" title="3BD087CC-1149-4520-B3BE-8E0427C6892B.png" alt="wKioL1YRTOvyPUPWAAHrZK3EBnI775.jpg" />

類RemoteFSSnapDriver主要是針對volume snapshot的一系列操作。

類RemoteFSDriver可以認為是一個base class,裡面定義了很多基本方法

上面提到的class都是關於server端的封裝。


client端的封裝已經獨立為一個項目:os-brick

os_brick/remotefs/remotefs.py,只有一個class RemoteFsClient,右邊是類中定義的方法。

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/74/0D/wKioL1YRUqng5AXVAAC1aI0wvv0686.jpg" title="BF5ACB8B-02C5-4695-A1DA-43312185B25C.png" alt="wKioL1YRUqng5AXVAAC1aI0wvv0686.jpg" />



未完待續。。。。。。




本文出自 “the-way-to-cloud” 部落格,請務必保留此出處http://iceyao.blog.51cto.com/9426658/1700198

cinder glusterfs driver代碼結構

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.