您好,登錄后才能下訂單哦!
下文給大家?guī)碚{(diào)用cinder-backup實現(xiàn)Freezer - 備份云硬盤,希望能夠給大家在實際運用中帶來一定的幫助,云硬盤涉及的東西比較多,理論也不多,網(wǎng)上有很多書籍,今天我們就用億速云在行業(yè)內(nèi)累計的經(jīng)驗來做一個解答。
freezer api底層的restful api框架是基于falcon實現(xiàn)的。falcon簡介:https://falconframework.org/
freezer scheduler基于APScheduler來實現(xiàn)定時備份的功能
具體實現(xiàn)見:https://github.com/yaoice/freezer-api/commit/4c3d371c28bc4635049bef4c037b7d1d36e9c532
使用curl測試api(freezer api使用keystone v2)
# keystone v2獲取token curl -s -d '{"auth":{"passwordCredentials":{"username": "admin", "password": "cloud"},"tenantName": "demo"}}' -H "Content-Type: application/json" http://192.168.141.6:5000/v2.0/tokens | python -m json.tool # keystone v3獲取token curl -i -H "Content-Type: application/json" -d ' { "auth": { "identity": { "methods": ["password"], "password": { "user": { "name": "admin", "domain": { "id": "default" }, "password": "cloud" } } } } }' http://localhost:5000/v3/auth/tokens ; echo # 獲取cinder所有的backups,純屬測試 curl -s -H "X-Auth-Token: fced5d5ae9e84009b3dca7972d7c5131"\ -X GET\ -H "Content-type: application/json"\ http://192.168.141.6:8776/v2/b232965aeb9c4b3a883ce41b16394e3f/backups | python -m json.tool # freezer獲取backup list curl -s -H "X-Auth-Token: fced5d5ae9e84009b3dca7972d7c5131" -X GET -H "Content-type: application/json" http://192.168.141.6:9090/v1/cinderbackups | python -m json.tool # freezer創(chuàng)建backup curl -s -H "X-Auth-Token: fd60f3b93b2841e893269b887572c26d" -X POST -H "Content-type: application/json" -d '{"volume_id": "438de34e-ef9e-4f4f-b047-600ab6229cc0"}' http://192.168.141.6:9090/v1/cinderbackups # freezer刪除backup curl -s -H "X-Auth-Token: 76744b82dd8c49c490eb7c0ca5f33824" -X DELETE -H "Content-type: application/json" http://192.168.141.6:9090/v1/cinderbackups/1ffe9901-43de-490e-b675-0bb92e50c4f4 # freezer還原備份,并創(chuàng)建一個新volume curl -s -H "X-Auth-Token: 232685c229fd48d4b24629f7748bceda" -X POST -H "Content-type: application/json" http://192.168.141.6:9090/v1/cinderrestores/ed3e05bd-c892-441c-b9c6-226bbb030794 # freezer針對某個volume備份還原 curl -s -H "X-Auth-Token: 232685c229fd48d4b2a629f7748bceda" -X POST -H "Content-type: application/json" -d '{"volume_id": "496a7db9-3197-4658-9cc6-ef496f2b0cd1"}' http://192.168.141.6:9090/v1/cinderrestores/da1b7290-5e56-43ff-b95f-a1c511b305d2
看了以上關(guān)于調(diào)用cinder-backup實現(xiàn)Freezer - 備份云硬盤,如果大家還有什么地方需要了解的可以在億速云行業(yè)資訊里查找自己感興趣的或者找我們的專業(yè)技術(shù)工程師解答的,億速云技術(shù)工程師在行業(yè)內(nèi)擁有十幾年的經(jīng)驗了。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。