部署cloud foundry问题记录
admin密码问题
bosh.yml中api_key字段写成了数字,修改成字符串即可
fanux@ubuntu:~/my-bosh$ bosh-init deploy ./bosh.yml
Deployment manifest: '/home/fanux/my-bosh/bosh.yml'
Deployment state: '/home/fanux/my-bosh/bosh-state.json'
Started validating
Downloading release 'bosh'... Skipped [Found in local cache] (00:00:00)
Validating release 'bosh'... Finished (00:00:02)
Downloading release 'bosh-openstack-cpi'... Skipped [Found in local cache] (00:00:00)
Validating release 'bosh-openstack-cpi'... Finished (00:00:00)
Validating cpi release... Finished (00:00:00)
Validating deployment manifest... Finished (00:00:00)
Downloading stemcell... Skipped [Found in local cache] (00:00:00)
Validating stemcell... Finished (00:00:03)
Finished validating (00:00:05)
Started installing CPI
Compiling package 'ruby_openstack_cpi/057ab554134a57606323ab07b317258fba9ef8a1'... Finished (00:00:00)
Compiling package 'bosh_openstack_cpi/055c07c1b8797e4b3b3a2014fee61d9c698f57d2'... Finished (00:00:00)
Installing packages... Finished (00:00:00)
Rendering job templates... Finished (00:00:00)
Installing job 'openstack_cpi'... Finished (00:00:00)
Finished installing CPI (00:00:00)
Starting registry... Finished (00:00:00)
Uploading stemcell 'bosh-openstack-kvm-ubuntu-trusty-go_agent/3232.4'... Failed (00:00:00)
Stopping registry... Finished (00:00:00)
Cleaning up rendered CPI jobs... Finished (00:00:00)
Command 'deploy' failed:
creating stemcell (bosh-openstack-kvm-ubuntu-trusty-go_agent 3232.4):
CPI 'create_stemcell' method responded with error: CmdError{"type":"InvalidCall","message":"Arguments are not correct, details: 'Invalid OpenStack cloud properties: #\u003cMembrane::SchemaValidationError: { openstack =\u003e { api_key =\u003e Expected instance of String, given an instance of Fixnum } }\u003e'","ok_to_retry":false}
Unable to connect to the OpenStack Image Service API
可能是identity版本问题,果然不出我所料。 把bosh.yml中的auth_url改成v2版本即可
改之前:
openstack: &openstack
auth_url: http://192.168.1.121/identity/
改之后:
openstack: &openstack
auth_url: http://192.168.1.121/identity/v2.0/
Command 'deploy' failed:
creating stemcell (bosh-openstack-kvm-ubuntu-trusty-go_agent 3232.4):
CPI 'create_stemcell' method responded with error: CmdError{"type":"Bosh::Clouds::CloudError","message":"Unable to connect to the OpenStack Image Service API: Expected([200, 204]) \u003c=\u003e Actual(404 Not Found)\nexcon.error.response\n :body =\u003e \"{\\\"error\\\": {\\\"message\\\": \\\"The resource could not be found.\\\", \\\"code\\\": 404, \\\"title\\\": \\\"Not Found\\\"}}\"\n :cookies =\u003e [\n ]\n :headers =\u003e {\n \"Content-Length\" =\u003e \"93\"\n \"Content-Type\" =\u003e \"application/json\"\n \"Date\" =\u003e \"Wed, 22 Jun 2016 09:35:40 GMT\"\n \"Server\" =\u003e \"Apache/2.4.7 (Ubuntu)\"\n \"Vary\" =\u003e \"X-Auth-Token\"\n }\n :host =\u003e \"192.168.1.121\"\n :local_address =\u003e \"192.168.1.121\"\n :local_port =\u003e 45237\n :path =\u003e \"/identity/tokens\"\n :port =\u003e 80\n :reason_phrase =\u003e \"Not Found\"\n :remote_ip =\u003e \"192.168.1.121\"\n :status =\u003e 404\n :status_line =\u003e \"HTTP/1.1 404 Not Found\\r\\n\"\n. Check task debug log for details.","ok_to_retry":false}
Security group `bosh' not found
openstack证书没有搞好。 重新生成证书。 因为重运行了./stack(devstack),之前的配置都没有了,所以得重新搞环境。 配置了证书安全组等等问题还是没解决。
坑在这: project(tenant)配置文件中写的是admin。而配置时写的是demo,所以出错。把配置文件的tenant改成demo即可
Stopping registry... Finished (00:00:00)
Cleaning up rendered CPI jobs... Finished (00:00:00)
Command 'deploy' failed:
Deploying:
Creating instance 'bosh/0':
Creating VM:
Creating vm with stemcell cid '63580cce-1770-4240-9db9-07cf4e2e2c08':
CPI 'create_vm' method responded with error: CmdError{"type":"Bosh::Clouds::CloudError","message":"Security group `bosh' not found","ok_to_retry":false}
Could not find service network
openstack没有安装网络模块导致的。devstack默认没有安装网络模块。
解决办法,重新安装devstack,添加网络模块。
安装时mysql连不上,local.conf里面配置了mysql密码注释掉重新运行./stack
装完了后重新开始部署bosh,配置openstack等。
Command 'deploy' failed:
Deploying:
Creating instance 'bosh/0':
Creating VM:
Creating vm with stemcell cid '63580cce-1770-4240-9db9-07cf4e2e2c08':
CPI 'create_vm' method responded with error: CmdError{"type":"Bosh::Clouds::CloudError","message":"OpenStack API service not found error: Could not find service network. Have compute, compute_legacy, identity, image, volume, volumev2, volumev3\nCheck task debug log for details.","ok_to_retry":false}
Image not found
猜测:Additionally, the VM CID is persisted in deployment state file in the same folder as the deployment manifest. cid还是之前的,被持久化了,导致没有更新。修改xxx.json文件。删除掉bosh-state.json文件,重新deploy出现另外一个问题,。
Started deploying
Creating VM for instance 'bosh/0' from stemcell '63580cce-1770-4240-9db9-07cf4e2e2c08'... Failed (00:00:02)
Failed deploying (00:00:04)
Stopping registry... Finished (00:00:00)
Cleaning up rendered CPI jobs... Finished (00:00:00)
Command 'deploy' failed:
Deploying:
Creating instance 'bosh/0':
Creating VM:
Creating vm with stemcell cid '63580cce-1770-4240-9db9-07cf4e2e2c08':
CPI 'create_vm' method responded with error: CmdError{"type":"Bosh::Clouds::CloudError","message":"Image `63580cce-1770-4240-9db9-07cf4e2e2c08' not found","ok_to_retry":false}
Server state is error, expected active
原因: bosh.yml中的instance_type是m1.xlarge需要16G内存,openstak创建不了这么大的。 改成m1.small.
Stopping registry... Finished (00:00:00)
Cleaning up rendered CPI jobs... Finished (00:00:00)
Command 'deploy' failed:
Deploying:
Creating instance 'bosh/0':
Creating VM:
Creating vm with stemcell cid 'bfc6290c-6cd5-4801-9ef9-170f13f97d59':
CPI 'create_vm' method responded with error: CmdError{"type":"Bosh::Clouds::VMCreationFailed","message":"Server `bb581471-12f6-40a2-a193-40e9e06cf735' state is error, expected active","ok_to_retry":true}
External network [net id] is not reachable from subnet [subnetid]
猜测:创建的网络命名有问题,配置文件中网络名称叫private而openstack里配置的叫aaa。
需要配置 公网带子网 私网带子网 公网和私网之间要通
Stopping registry... Finished (00:00:00)
Cleaning up rendered CPI jobs... Finished (00:00:00)
Command 'deploy' failed:
Deploying:
Creating instance 'bosh/0':
Creating VM:
Creating vm with stemcell cid 'bfc6290c-6cd5-4801-9ef9-170f13f97d59':
CPI 'create_vm' method responded with error: CmdError{"type":"Bosh::Clouds::VMCreationFailed","message":"OpenStack API Bad Request (Unable to associate floating IP 192.168.1.252 to fixed IP 10.0.0.4 for instance c41147e6-f11a-4d63-aa60-18a8522e44b0. Error: External network 49d9b696-2ef4-4d73-ae9a-f560b2b2dd73 is not reachable from subnet 138708b6-1a49-42e0-9b4b-402c3c66401c. Therefore, cannot associate Port daefd87d-fcb8-4167-92fd-639bd2c1aa8f with a Floating IP.\nNeutron server returns request_ids: ['req-e0bd44de-e4fa-4911-8a49-3f93c0b0bdb8']). Check task debug log for details.","ok_to_retry":true}
ssh connect time out
Stopping registry... Finished (00:00:00)
Cleaning up rendered CPI jobs... Finished (00:00:00)
Command 'deploy' failed:
Deploying:
Creating instance 'bosh/0':
Waiting until instance is ready:
Starting SSH tunnel:
Failed to connect to remote server:
dial tcp 192.168.1.252:22: getsockopt: connection timed out