1.2、endpoint版本问题
bosh micro deploy /var/vcap/stemcells/micro-bosh-stemcell-openstack-kvm-0.8.1.tgz
报错信息:
response => #<Excon::Response:0x00000000992b90 @body="{\"versions\": [{\"status\": \"EXPERIMENTAL\", \"id\": \"v2\", \"links\": [{\"href\": \"http://ip:9292/v2/\", \"rel\": \"self\"}]}, {\"status\": \"CURRENT\", \"id\": \"v1.1\", \"links\": [{\"href\": \"http://ip:9292/v1/\", \"rel\": \"self\"}]}, {\"status\": \"SUPPORTED\", \"id\": \"v1.0\", \"links\": [{\"href\": \"http://ip:9292/v1/\", \"rel\": \"self\"}]}]}", @headers={"Content-Type"=>"application/json", "Content-Length"=>"340", "Date"=>"Wed, 22 Aug 2013 16:38:30 GMT"}, @status=300>
这是应为glance endpoint的fog组件不支持v2.0,只支持v1.0和v1.1
解决办法:需要重新建v1.0的endpoint,执行以下命令:
keystone endpoint-create \
--region RegionOne \
--service_id c933887a2e3341b18bdae2c92e6f1ba7 \
--publicurl "http://10.68.19.61:9292/v1.0" \
--adminurl "http://10.68.19.61:9292/v1.0" \
--internalurl "http://10.68.19.61:9292/v1.0"
注意修改service_id和各url,并且需要删除原来的v2版本的endpoint,否则会报重复定义。
经验总结:文档一类的东西,并不是说官方的就表示肯定是正确的,要对任何技术文档都抱有怀疑态度,遇到问题首先考虑自己的操作是否是否,确认无误后要去了解官方文档的正确性,在安装openstack、Bosh、CloudFoundry的过程中,很多问题官方文档并未指出,但确实存在。
2、部署Bosh碰到的问题 2.1、部署Bosh时quota超额问题
执行bosh deploy部署Bosh时,会出现以下报错信息:
Creating bound missing VMs
small/2: Expected([200, 202]) <=> Actual(413 Request Entity Too Large)
request => {:connect_timeout=>60, :headers=>{"Content-Type"=>"application/json", "X-Auth-Token"=>"38fe51b931184a30a287e71bc37cc05d", "Host"=>"10.23.54.150:8774", "Content-Length"=>422}, :instrumentor_name=>"excon", :mock=>false, :nonblock=>true, :read_timeout=>60, :retry_limit=>4, :ssl_ca_file=>"/var/vcap/packages/director/bosh/director/vendor/bundle/ruby/1.9.1/gems/excon-0.16.2/data/cacert.pem", :ssl_verify_peer=>true, :write_timeout=>60, :host=>"10.23.54.150", :path=>"/v2/69816bacecd749f9ba1d68b3c8bae1f1/servers.json", :port=>"8774", :query=>"ignore_awful_caching1362453746", :scheme=>"http", :body=>"{\"server\":{\"flavorRef\":\"25\",\"imageRef\":\"e205b9ec-0e19-4500-87fe-ede3af13b227\",\"name\":\"vm-b875d6d8-81ce-483b-bfa8-d6d525aaf280\",\"metadata\":{},\"user_data\":\"eyJyZWdpc3RyeSI6eyJlbmRwb2ludCI6Imh0dHA6Ly8xMC4yMy41MS4zNToy\\nNTc3NyJ9LCJzZXJ2ZXIiOnsibmFtZSI6InZtLWI4NzVkNmQ4LTgxY2UtNDgz\\nYi1iZmE4LWQ2ZDUyNWFhZjI4MCJ9LCJkbnMiOnsibmFtZXNlcnZlciI6WyIx\\nMC4yMy41NC4xMDgiXX19\\n\",\"key_name\":\"jae2\",\"security_groups\":[{\"name\":\"default\"}]}}", :expects=>[200, 202], :method=>"POST"}
response => #<Excon::Response:0x00000004edec30 @body="{\"overLimit\": {\"message\": \"Quota exceeded for instances: Requested 1, but already used 10 of 10 instances\", \"code\": 413}}", @headers={"Retry-After"=>"0", "Content-Length"=>"121", "Content-Type"=>"application/json; charset=UTF-8", "X-Compute-Request-Id"=>"req-c5427ed2-62af-47b9-98a6-6f114893d8fc", "Date"=>"Tue, 05 Mar 2013 03:22:27 GMT"}, @status=413> (00:00:02)
这是OpenStack相关工程quota配额不足而导致出现的错误
解决办法:修改openstack中该工程的quota配额,可以将CPU数、内存、硬盘、IP等都调整的的较大,并将原来的deployments删除,命令如下:
bosh deployments
bosh delete deployment 名称
回滚之前部署时的操作,否则会出现错误,提示某个vm找不到,回滚后如果还存在问题,看看是否有缓存的yml文件,还有nova库中的instances等几个实例相关的表是否还存在没有删除的内容。