制做的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 修改到数据库服务器