Docker使用OpenStack Cinder持久化volume原理分析及實踐

1 背景知識

1.1 OpenStack Cinder簡介

OpenStack Cinder為OpenStack提供塊存儲服務,其功能類似AWS的EBS服務,目前使用最多的是為OpenStack Nova虛擬機提供虛擬硬碟功能,即把volume掛載到虛擬機中,作為附加彈性硬碟使用,關於OpenStack Cinder volume掛載到虛擬機的過程分析可以參考之前寫的博客OpenStack虛擬機掛載數據卷過程分析,這篇博客也是了解本文內容的基礎。

但是,OpenStack Cinder不僅僅是為Nova虛擬機提供雲硬碟功能,事實上,Cinder並不關心是誰在消費它的volume,除了虛擬機,還有可能是物理機和容器。Cinder volume掛載到物理機前面已經介紹過,可以參考OpenStack中那些很少見但很有用的操作。Cinder volume掛載到虛擬機以及物理機都介紹過了,剩下最後一個內容,Cinder volume如何掛載到Docker容器中呢,本文接下來將詳細介紹並通過兩個driver實例實踐。

1.2 Docker volume簡介

我們知道Docker容器本身是無狀態的,意味著容器退出後不會保存任何數據。但實際使用場景,肯定是需要保存業務數據的,Docker通過volume實現數據的持久化存儲以及共享。

默認情況下,Docker會使用本地目錄作為容器的volume掛載到容器實例指定的路徑。用戶可以指定已經存在的路徑作為Docker volume,如下:

mkdir datandocker run -t -i --rm -v `pwd`/data:/data busyboxn

以上把本地data目錄掛載到容器/data路徑中,注意源目錄路徑必須使用絕對路徑,否則Docker會當作volume name。

你也可以不指定本地路徑,此時Docker會自動創建一個新的空目錄作為Docker volume:

docker run -t -i --rm -v /data busyboxn

可以使用docker volume ls查看創建的volume:

$ docker volume lsnDRIVER VOLUME NAMEnlocal 0e8d4d3936ec3b84c2ee4db388f45cbe5c84194d89d69be6b7a616fbdf1ea788n

通過inspect子命令查看源路徑path:

$ docker volume inspect 0e8d4d3936ec3b84c2ee4db388f45cbe5c84194d89d69be6b7a616fbdf1ea788n[n {n "CreatedAt": "2017-09-30T17:21:56+08:00",n "Driver": "local",n "Labels": null,n "Mountpoint": "/var/lib/docker/volumes/0e8d...788/_data",n "Name": "0e8d4d3936ec3b84c2ee4db388f45cbe5c84194d89d69be6b7a616fbdf1ea788",n "Options": {},n "Scope": "local"n }n]n

從以上輸出的結果可看出本地源目錄為/var/lib/docker/volumes/0e8d...788/_data,這個目錄是Docker自動創建的。

由此我們也得出結論,Docker創建的volume只能用於當前宿主機的容器使用,不能掛載到其它宿主機的容器中,這種情況下只能運行些無狀態服務,對於需要滿足HA的有狀態服務,則需要使用分散式共享volume持久化數據,保證宿主機掛了後,容器能夠遷移到另一台宿主機中。而Docker本身並沒有提供分散式共享存儲方案,而是通過插件(plugin)機制實現與第三方存儲系統對接集成,下節我們詳細介紹。

1.3 Docker volume plugin介紹

前面提到Docker本身並沒有提供分散式共享volume方案實現,而是提供了一種靈活的插件機制,通過插件能夠集成第三方的分散式共享系統,用戶只需要實現plugin driver的介面就可以自定義對接自己的任何存儲系統。如當前非常流行的開源分散式存儲系統Ceph、AWS EBS、OpenStack Cinder等,這些外部存儲系統我們稱為Provider。

值得一提的是,官方在volume plugin協議文檔中強調:

If a plugin registers itself as a VolumeDriver when activated, it must provide the Docker Daemon with writeable paths on the host filesystem.

這句話的理解就是說,Docker不能直接讀寫外部存儲系統,而必須把存儲系統掛載到宿主機的本地文件系統中,Docker當作本地目錄掛載到容器中,換句話說,只要外部存儲設備能夠掛載到本地文件系統就可以作為Docker的volume。比如對於ceph rbd,需要先map到本地,並掛載到宿主機指定的路徑中,這個路徑稱為path。這裡和虛擬機不一樣,rbd掛載到虛擬機,QEMU能夠直接通過rbd協議讀寫,不需要map到本地。

我們要想了解Docker掛載分散式存儲系統的原理,首先需要了解下官方定義的plugin協議介面:

  • create: 創建一個volume。
  • remove: 刪除一個volume。
  • mount: 掛載一個volume到容器中。
  • umount: 從容器中卸載一個volume。
  • get/list: 獲取volume信息。

以上create和remove都比較簡單,最為核心的兩個介面為mount和umount,不同的存儲系統,介面實現不一樣,我們這裡只關心Cinder介面的實現。在此之前我沒有過多研究,不妨我們就用前面了解的知識大膽猜想下Docker使用Cinder volume的實現原理。

1.4 Docker使用Cinder volume原理猜想

前面我們介紹了Docker plugin介面,現在假設我們需要對接OpenStack Cinder,Cinder存儲後端(backend)使用LVM,猜測Docker plugin介面實現如下:

  • create: 直接調用Cinder API創建一個volume。
  • remote: 直接調用Cinder API刪除一個volume。
  • get/list: 直接調用Cinder API獲取volume列表。
  • mount: 前面提到Docker volume必須先掛載到本地,而這不正是恰好對應Cinder的local-attach么,具體內容可以參考OpenStack中那些很少見但很有用的操作。local attach到本地設備後,如果塊設備沒有安裝文件系統,則mount操作還需要執行文件系統格式化。創建完文件系統後,只需要mount到宿主機文件系統就可以了,Docker並不關心底層到底是什麼存儲系統,它只是把它當作宿主機的一個目錄,剩下的工作就和Docker掛載本地目錄一樣了。
  • umount: 不需要解釋,已經非常明了,只需要從本地文件系統umount,然後從本地設備detach。

目前Docker掛載Cinder volume的方案還挺多的,如:

  • docker cinder driver: Docker Volume Plugin to enable consumption of OpenStack-Cinder Block Storage with containers.
  • fuxi: Enable Docker container to use Cinder volume and Manila share.
  • REX-Ray:storage management solution designed to support container runtimes such as Docker and Mesos.
  • Flocker: Flocker is an open-source container data volume orchestrator for your Dockerized applications.

以上原理只是我們的猜想,猜想是不是成立,我們接下來通過以上方案研究實踐下即可驗證。

2 docker cinder driver實踐

2.1 docker cinder driver簡介

docker-cinder-driver是由john griffith開發的,實現了Docker掛載Cinder卷Driver。作者還寫了篇專門的博客介紹Cinder - Block Storage for things other than Nova,也可以參考作者於OpenStack Days East 2016的分享pptslides: Consuming Cinder from Docker以及2016年奧斯汀分享視頻cinder and docker like peanut butter and chocolate。

2.2 環境準備

實驗之前本人已經使用DevStack工具部署了一個allinone OpenStack測試環境,代碼基於最新的master分支,對應Cinder commit為2b58f2bb04c229c738b5cc806575ed3503fd1bfe。 Cinder使用LVM後端存儲(backend),配置如下:

[lvmdriver-1]nimage_volume_cache_enabled = Truenvolume_clear = zeronlvm_type = autoniscsi_helper = tgtadmnvolume_group = stack-volumes-lvmdriver-1nvolume_driver = cinder.volume.drivers.lvm.LVMVolumeDrivernvolume_backend_name = lvmdriver-1 n

後續操作都是在這個DevStack環境中進行,不再強調。

docker cinder driver文檔中說可以直接通過install.sh腳本下載:

curl -sSl https://raw.githubusercontent.com/j-griffith/cinder-docker-driver/master/install.sh | shn

但這樣下載的可能不是最新代碼編譯的(親測有坑),為了使用最新的版本,我們只能手動編譯,首先需要安裝go開發環境,關於go語言開發環境可以參考官方安裝文檔。

ubuntu可以直接使用apt-get安裝:

sudo apt-get install golang-gon

下載cinder-docker-driver源碼到本地:

git clone https://github.com/j-griffith/cinder-docker-drivern

使用go build直接編譯:

cd cinder-docker-drivernmkdir -p vendor/srcnln -s `pwd`/vendor/golang.org/ vendor/srcnln -s `pwd`/vendor/github.com vendor/srcnexport GOPATH=`pwd`/vendorngo buildn

創建配置文件,主要包含Cinder的認證信息:

mkdir -p /var/lib/cinder/dockerdriverncat >/var/lib/cinder/dockerdriver/config.json <<EOFn{n "Endpoint": "http://10.0.2.15/identity/v3",n "Username": "admin",n "Password": "nomoresecret",n "TenantID": "ae21d957967d4df0865411f0389ed7e8",n "DomainName": "Default",n "Region": "RegionOne"n}nEOFn

其中Endpoint為認證URL,注意包含版本/v3,且必須包含DomainName配置項。

配置完成後就可以直接運行cinder-docker-driver服務了:

nohup ./cinder-docker-driver &ntailf ./nohupn

2.3 功能驗證

使用docker創建一個volume,如下:

root@devstack:~# docker volume create -d cinder --name int32bit-test-1 -o size=2nint32bit-test-1nroot@devstack:~# docker volume lsnDRIVER VOLUME NAMEncinder int32bit-test-1n

啟動一個容器並掛載int32bit-test-1:

root@devstack:~# docker run -t -i --rm -v int32bit-test-1:/int32bit-test-1 busyboxn/ # cd /int32bit-test-1/n/int32bit-test-1 # lsnlost+foundn/int32bit-test-1 # echo "HelloWorld" >hello.txtn/int32bit-test-1 # lsnhello.txt lost+foundn

以上我們掛載剛剛創建的volume到/int32bit-test-1中,並寫了HelloWorld到hello.txt文件中。

啟動容器時cinder-docker-driver日誌如下:

time="2017-09-29T21:29:44+08:00" level=debug msg="Found Volume ID: 58837c2b-af79-4f89-97ea-40e2622d2c52"ntime="2017-09-29T21:29:44+08:00" level=debug msg="Gather up initiator IQNs..."ntime="2017-09-29T21:29:44+08:00" level=debug msg="Found the following iqns: [iqn.1993-08.org.debian:01:19a8a9ca754f]"ntime="2017-09-29T21:29:44+08:00" level=debug msg="Value of IPs is=[127.0.0.1/8 10.0.2.15/24 192.168.99.101/24 192.168.122.1/24 172.17.0.1/16 ::1/128 fe80::a00:27ff:fe94:2f20/64 fe80::a00:27ff:fe69:2326/64 fe80::42:bcff:fee4:89ac/64]n"ntime="2017-09-29T21:29:44+08:00" level=debug msg="Issue InitializeConnection..."ntime="2017-09-29T21:29:47+08:00" level=debug msg="Create the node entry using args: [-m node -T iqn.2010-10.org.openstack:volume-58837c2b-af79-4f89-97ea-40e2622d2c52 -p 10.0.2.15:3260]"ntime="2017-09-29T21:29:47+08:00" level=debug msg="Update username to: 36eDQkERhAAKXGi8CMFC"ntime="2017-09-29T21:29:47+08:00" level=debug msg="Update password to: GLFkwC6eV8abbtk8"ntime="2017-09-29T21:29:48+08:00" level=info msg="Logged into iSCSI target without error: [-m node -T iqn.2010-10.org.openstack:volume-58837c2b-af79-4f89-97ea-40e2622d2c52 -p 10.0.2.15:3260 --login]"ntime="2017-09-29T21:29:48+08:00" level=info msg="Waiting for path"ntime="2017-09-29T21:29:49+08:00" level=debug msg="path found: /dev/disk/by-path/ip-10.0.2.15:3260-iscsi-iqn.2010-10.org.openstack:volume-58837c2b-af79-4f89-97ea-40e2622d2c52-lun-1"ntime="2017-09-29T21:29:49+08:00" level=debug msg="Begin utils.getDeviceFileFromIscsiPath: /dev/disk/by-path/ip-10.0.2.15:3260-iscsi-iqn.2010-10.org.openstack:volume-58837c2b-af79-4f89-97ea-40e2622d2c52-lun-1"ntime="2017-09-29T21:29:49+08:00" level=debug msg="Found device: [lrwxrwxrwx 1 root root 9 Sep 29 21:29 /dev/disk/by-path/ip-10.0.2.15:3260-iscsi-iqn.2010-10.org.openstack:volume-58837c2b-af79-4f89-97ea-40e2622d2c52-lun-1 -> sddn]"ntime="2017-09-29T21:29:49+08:00" level=debug msg="using base of: /dev/sdd"ntime="2017-09-29T21:29:49+08:00" level=debug msg="Attached volume at (path, devfile): /dev/disk/by-path/ip-10.0.2.15:3260-iscsi-iqn.2010-10.org.openstack:volume-58837c2b-af79-4f89-97ea-40e2622d2c52-lun-1, /dev/sdd"ntime="2017-09-29T21:29:49+08:00" level=debug msg="iSCSI connection done"ntime="2017-09-29T21:29:49+08:00" level=debug msg="Begin utils.GetFSType: /dev/sdd"ntime="2017-09-29T21:29:49+08:00" level=debug msg="Formatting device"ntime="2017-09-29T21:29:49+08:00" level=debug msg="Begin utils.FormatVolume: /dev/sdd, ext4"ntime="2017-09-29T21:29:49+08:00" level=debug msg="Perform mkfs.ext4 on device: /dev/sdd"ntime="2017-09-29T21:29:50+08:00" level=debug msg="Result of mkfs cmd: mke2fs 1.42.13 (17-May-2015)nCreating filesystem with 524288 4k blocks and 131072 inodesnFilesystem UUID: 02318688-7448-4d25-98dd-0527a2bd9733nSuperblock backups stored on blocks: nt32768, 98304, 163840, 229376, 294912ntAllocating group tables: 0/16 done ntWriting inode tables: 0/16 done ntCreating journal (16384 blocks): donentWriting superblocks and filesystem accounting information: 0/16 done"ntime="2017-09-29T21:29:50+08:00" level=debug msg="Begin utils.Mount device: /dev/sdd on: /var/lib/cinder/mount/int32bit-test-1"ntime="2017-09-29T21:29:50+08:00" level=debug msg="Response from mount /dev/sdd at /var/lib/cinder/mount/int32bit-test-1: "ntime="2017-09-29T21:29:50+08:00" level=debug msg="Call gophercloud Attach..."ntime="2017-09-29T21:29:50+08:00" level=debug msg="Attach results: {ErrResult:{Result:{Body:<nil> Header:map[] Err:<nil>}}}"n

從日誌中可以看出掛載volume本質就是通過iscsi把volume attach到本地(local attach),格式化為ext4文件系統,然後掛載到宿主機/var/lib/cinder/mount目錄中,與我們猜想過程基本一致。

可以通過lsblk確認:

root@devstack:~/cinder-docker-driver# lsblk -s | grep int32bit-testnsddtt8:48 0 2G 0 disk /var/lib/cinder/mount/int32bit-test-1n

從docker容器實例中退出,此時會自動把volume從本地detach。

我們使用cinder把創建的卷手動attach到本地並掛載,關於Cinder的local attach,可參考OpenStack中那些很少見但很有用的操作。

root@devstack:~# cinder listn+--------------------------------------+-----------+-----------------+------+-------------+----------+-------------+n| ID | Status | Name | Size | Volume Type | Bootable | Attached to |n+--------------------------------------+-----------+-----------------+------+-------------+----------+-------------+n| 58837c2b-af79-4f89-97ea-40e2622d2c52 | available | int32bit-test-1 | 2 | lvmdriver-1 | false | |n+--------------------------------------+-----------+-----------------+------+-------------+----------+-------------+nroot@devstack:~# cinder local-attach 58837c2b-af79-4f89-97ea-40e2622d2c52n+----------+-----------------------------------+n| Property | Value |n+----------+-----------------------------------+n| path | /dev/sdd |n| scsi_wwn | 360000000000000000e00000000010001 |n| type | block |n+----------+-----------------------------------+nroot@devstack:~# mount /dev/sdd /mntn

查看前面我們寫的文件:

root@devstack:~# cat /mnt/hello.txtnHelloWorldn

可見輸出了我們通過容器寫的HelloWorld。

通過docker cinder driver基本驗證了我們之前的猜想是正確的。

3 fuxi

3.1 fuxi項目簡介

OpenStack fuxi是一個比較新的項目,最初是從magnum項目分離出來,於2016年2月26號被OpenStack社區接受成為社區項目,目前主要由華為主導開發,其目標是使Docker容器可以使用Cinder volume和Manila share作為持久化存儲卷。

3.2 環境準備

OpenStack環境仍然使用之前的DevStack環境,fuxi安裝過程如下。

首先安裝依賴的包,這些包其實DevStack基本都已經安裝完成了。

sudo apt-get updatensudo apt-get install python-dev git libffi-dev libssl-dev gccnsudo apt-get install open-iscsinsudo apt-get install sysfsutilsn

下載fuxi源碼並安裝:

git clone https://github.com/openstack/fuxi.gitncd fuxinsudo pip install -r requirements.txtnsudo python setup.py installnln -s /lib/udev/scsi_id /usr/local/bin # for root n

使用generate_config_file_samples.sh生成配置文件模板,並拷貝到/etc/fuxi目錄下。

./tools/generate_config_file_samples.shnsudo cp etc/fuxi.conf.sample /etc/fuxi/fuxi.confn

修復配置文件,最終配置文件如下:

root@devstack:~# cat /etc/fuxi/fuxi.conf | grep -v ^# | grep -v ^$n[DEFAULT]nmy_ip = 10.0.2.15nvolume_providers = cindern[cinder]nregion_name = RegionOnenvolume_connector = osbricknfstype = ext4nauth_url = http://10.0.2.15/identity/v3nproject_name = adminnproject_domain_name = Defaultnusername = adminnuser_domain_name = Defaultnpassword = nomoresecretn[keystone]n[manila]nvolume_connector = osbricknauth_type = passwordn[nova] n

注意auth_url必須包含版本,如/v3。

啟動服務:

fuxi-server --config-file /etc/fuxi/fuxi.confn

3.3 功能驗證

使用Docker創建一個volume:

$ docker volume create -d fuxi --name int32bit-test-fuxinint32bit-test-fuxin$ docker volume ls | grep int32bit-test-fuxinfuxi int32bit-test-fuxin

掛載volume到Docker容器中:

$ docker run -ti --rm -v int32bit-test-fuxi:/int32bit-test-fuxi busyboxn/ # cd /int32bit-test-fuxi/n/int32bit-test-fuxi # lsna b c lost+foundn

我們可以驗證volume其實是映射到本地路徑的:

$ lsblk -SfnNAME HCTL TYPE VENDOR MODEL REV TRAN NAME FSTYPE LABEL UUID MOUNTPOINTnsda 2:0:0:0 disk ATA VBOX HARDDISK 1.0 sata sdansdb 11:0:0:1 disk IET VIRTUAL-DISK 0001 iscsi sdb ext4 d04b16a1-3392-41df-999f-e6c36b5d0cd6 /fuxi/data/cinder/int32bit-test-fuxinsr0 1:0:0:0 rom VBOX CD-ROM 1.0 ata sr0n

由此可見,fuxi首先把Volume attach到本地,並mount到指定路徑中,然後mount到Docker容器中,又和我們的猜想一致,接下來我們從源碼角度分析。

3.4 Docker使用fuxi掛載volume源碼分析

fuxi掛載是通過fuxi/volumeprovider/cinder.py模塊的Cinder類實現的,該類實現了provider.Provider介面,而該介面就是對應前面介紹的Docker volume plugin介面。我們主要研究其mount方法:

def mount(self, docker_volume_name):n cinder_volume, state = self._get_docker_volume(docker_volume_name)n LOG.info("Get docker volume %(d_v)s %(vol)s with state %(st)s",n {d_v: docker_volume_name, vol: cinder_volume,n st: state})n connector = self._get_connector()n if state == NOT_ATTACH:n connector.connect_volume(cinder_volume)n elif state == ATTACH_TO_OTHER:n if cinder_volume.multiattach:n connector.connect_volume(cinder_volume)n else:n msg = _("Volume {0} {1} is not shareable").format(n docker_volume_name, cinder_volume)n raise exceptions.FuxiException(msg)n elif state != ATTACH_TO_THIS:n msg = _("Volume %(vol_name)s %(c_vol)s is not in correct state, "n "current state is %(state)s")n LOG.error(msg, {vol_name: docker_volume_name,n c_vol: cinder_volume,n state: state})n raise exceptions.NotMatchedState()n... n

以上主要通過Cinder API獲取volume信息,檢查其attach情況:

  • 如果volume沒有attach,則直接attach。
  • 如果volume已經attach(in-use)到其它主機,則檢查其是否支持multiattach,如果支持多掛載,則直接掛載,否則拋出異常,掛載失敗。
  • 如果volume已經attach到當前主機,則說明已經掛載到本地了,但這不是我們所期望的,因此直接拋出異常。

假設前面都沒有問題,順利把volume attach到本地,則我們可以獲取映射到本地的虛擬設備名,接下來的代碼就是簡單檢查該路徑是否就緒:

...n link_path = connector.get_device_path(cinder_volume)n if not os.path.exists(link_path):n LOG.warning("Could not find device link file, "n "so rebuild it")n connector.disconnect_volume(cinder_volume)n connector.connect_volume(cinder_volume)nn devpath = os.path.realpath(link_path)n if not devpath or not os.path.exists(devpath):n msg = _("Cant find volume device path")n LOG.error(msg)n raise exceptions.FuxiException(msg)n ...n

如果前面順利獲取到volume的設備名,比如/dev/sdd,則最後的工作就是mount到本地文件系統了:

...

mountpoint = self._get_mountpoint(docker_volume_name)n self._create_mountpoint(mountpoint)n fstype = cinder_volume.metadata.get(fstype, cinder_conf.fstype)n mount.do_mount(devpath, mountpoint, fstype)n return mountpointn

其中mountpoint是掛載的目標目錄,其路徑為volume_dir + volume_type + volume_name,其中volume_dir通過配置文件配置,默認為/fuxi/data,volume_type這裡為cinder,假設volume name為int32bit-test-volume,則掛載路徑為/fuxi/data/cinder/int32bit-test-volume。

_create_mountpoint就是創建掛載目錄:

def _create_mountpoint(self, mountpoint):n """Create mount point directory for Docker volume.n :param mountpoint: The path of Docker volume.n """n try:n if not os.path.exists(mountpoint) or not os.path.isdir(mountpoint):n utils.execute(mkdir, -p, -m=755, mountpoint,n run_as_root=True)n LOG.info("Create mountpoint %s successfully", mountpoint)n except processutils.ProcessExecutionError as e:n LOG.error("Error happened when create volume "n "directory. Error: %s", e)n raisen

最後調用mount.do_mount,mount是fuxi實現的一個通用的mount庫,代碼位於fuxi/common/mount.py。

def do_mount(devpath, mountpoint, fstype):n """Execute device mount operation.nn :param devpath: The path of mount device.n :param mountpoint: The path of mount point.n :param fstype: The file system type.n """n try:n if check_already_mounted(devpath, mountpoint):n returnnn mounter = Mounter()n mounter.mount(devpath, mountpoint, fstype)n except exceptions.MountException:n try:n mounter.make_filesystem(devpath, fstype)n mounter.mount(devpath, mountpoint, fstype)n except exceptions.FuxiException as e:n with excutils.save_and_reraise_exception():n LOG.error(str(e))n

該方法直接調用Mounter的mount方法,如果mount失敗,則重新創建格式化文件系統後再次掛載(第一次掛載時沒有安裝文件系統,因此mount必然失敗)。mount方法如下:

def mount(self, devpath, mountpoint, fstype=None):n try:n if fstype:n utils.execute(mount, -t, fstype, devpath, mountpoint,n run_as_root=True)n else:n utils.execute(mount, devpath, mountpoint,n run_as_root=True)n except processutils.ProcessExecutionError as e:n msg = _("Unexpected error while mount block device. "n "Devpath: {0}, "n "Mountpoint: {1} "n "Error: {2}").format(devpath, mountpoint, e)n raise exceptions.MountException(msg)n

由此我們通過研究源碼,再次驗證了我們之前的猜想是正確的。

4 REX-Ray

REX-Ray是一個EMC團隊領導的開源項目,為Docker、Mesos及其他容器運行環境提供持續的存儲訪問。其設計旨在囊括通用存儲、虛擬化和雲平台,提供高級的存儲功能。換句話說,REX-Ray進一步封裝,提供一個統一的為Docker提供volume的工具,整合了各種不同的provide,如Ceph、Cinder、EBS等。但遺憾的是,目前Docker掛載Cinder卷,Docker必須安裝在Nova虛擬機中,虛擬機還必須能夠和OpenStack管理網打通,參考Cinder: failed to attach volume while using cinder driver,因此實際使用場景有限,本文不再詳細介紹。

5 參考文獻

  1. docker extend: plugin volume.
  2. How to use OpenStack Cinder for Docker.
  3. Cinder - Block Storage for things other than Nova.
  4. cinder-docker-driver.
  5. What is Floker.
  6. Rex-Ray.
  7. fuxi.
  8. Cinder: failed to attach volume while using cinder driver.
  9. OpenStack中那些很少見但很有用的操作.
  10. OpenStack虛擬機掛載數據卷過程分析.

中秋節快樂!

推薦閱讀:

Docker的作用的主要作用是什麼?
關於/var/run/docker.sock
Insta360容器化&DevOps之路
探討一下,docker/compose 中關於 link 的設計怎麼樣?

TAG:OpenStack | Docker | 云计算 |