製做的windows鏡像至少7G以上,經過命令行上傳(實際走的仍是http通信)服務器常常返回502。
502 Bad Gateway: Bad Gateway: The proxy server received an invalid: response from an upstream server.: Apache/2.4.18 (Ubuntu) Server at 192.168.18.61 Port 80 (HTTP 502)數據庫
經驗證,經過如下方式能夠輕鬆上傳大鏡像windows
cd /opt/image/ touch dummy
glance image-create --name win7 --file /opt/image/dummy --disk-format qcow2 --container-format bare --visibility public --progress
+------------------+--------------------------------------+ | Property | Value | +------------------+--------------------------------------+ | checksum | d41d8cd98f00b204e9800998ecf8427e | | container_format | bare | | created_at | 2018-05-17T01:23:36Z | | disk_format | qcow2 | | id | f7fbe797-184a-4c5d-ad67-67cb254539a2 | | min_disk | 0 | | min_ram | 0 | | name | win7 | | owner | 3bc17302ef9f465ba390fa036a35a34e | | protected | False | | size | 0 | | status | active | | tags | [] | | updated_at | 2018-05-17T01:23:37Z | | virtual_size | None | | visibility | public | +------------------+--------------------------------------+
vi /etc/glance/glance-api.conf [glance_store] filesystem_store_datadir = /opt/stack/data/glance/images/
cp /opt/image/win7.qcow2 f7fbe797-184a-4c5d-ad67-67cb254539a2
因爲上傳dummy時,glance計算了size和md5sum並保存數據庫了,很顯然不一樣於真正的鏡像的計算結果。
能夠經過直接修改數據的方式改過來api
-rw-r--r-- 1 stack stack 7836008448 May 17 09:26 f7fbe797-184a-4c5d-ad67-67cb254539a2
把7836008448 修改到數據庫服務器