您好,登錄后才能下訂單哦!
下文給大家帶來調用cinder-backup實現Freezer - 備份云硬盤,希望能夠給大家在實際運用中帶來一定的幫助,云硬盤涉及的東西比較多,理論也不多,網上有很多書籍,今天我們就用億速云在行業內累計的經驗來做一個解答。
freezer api底層的restful api框架是基于falcon實現的。falcon簡介:https://falconframework.org/
freezer scheduler基于APScheduler來實現定時備份的功能
具體實現見: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創建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還原備份,并創建一個新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
看了以上關于調用cinder-backup實現Freezer - 備份云硬盤,如果大家還有什么地方需要了解的可以在億速云行業資訊里查找自己感興趣的或者找我們的專業技術工程師解答的,億速云技術工程師在行業內擁有十幾年的經驗了。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。