cloudfoundry / bosh-openstack-cpi-release

BOSH OpenStack CPI
Apache License 2.0
36 stars 59 forks source link

human_readable_vm_names: true does not work for cloudfoundry VMs #25

Closed malik-altaf closed 8 years ago

malik-altaf commented 8 years ago

`I have used the property ' human_readable_vm_names: true' and created the director. The director VM is named correctly as bosh/0. However when I deploy the CF release, my VMs are still named the old way. Please have a look at the following output.

$nova list

+--------------------------------------+-----------------------------------------+--------+------------+-------------+------------------------------------+
| ID                                   | Name                                    | Status | Task State | Power State | Networks                           |
+--------------------------------------+-----------------------------------------+--------+------------+-------------+------------------------------------+
| dea468d9-637d-4fc1-ad1e-20d053302f23 | bosh/0                                  | ACTIVE | -          | Running     | cf2-net=192.168.0.2, XXX.XXX.XX.XX |
| fcd2a99b-3c28-465e-8bd9-ef3416bfde9b | vm-0e31d9a0-1206-4fd9-926d-f26bc3584c9c | ACTIVE | -          | Running     | cf2-net=192.168.1.31               |
| 9c80f7da-24a0-431d-b770-4b0888fd5adb | vm-1565ffcd-cda0-46f3-9f81-2b1ac137ed62 | ACTIVE | -          | Running     | cf2-net=192.168.1.39               |
| ba2ed754-7083-40b2-b333-dc9a5016e2f2 | vm-19d6939e-3c39-4ed9-9276-7b9b23bcdcc6 | ACTIVE | -          | Running     | cf2-net=192.168.1.6                |
| 6438d44f-c410-4d13-9976-818105673d25 | vm-1c5aad32-9e60-4a1d-8c27-0d8ae38e3778 | ACTIVE | -          | Running     | cf2-net=192.168.1.38               |
| 41993cfb-812a-4cd5-bed8-a7584075d1f9 | vm-1e8d8e5a-f11b-4ef9-a425-6273aa32e345 | ACTIVE | -          | Running     | cf2-net=192.168.1.37               |
| 42381136-71e6-4ec1-be55-de745c3f64f7 | vm-26ad865d-f499-4685-9d1f-dca85d29f4d7 | ACTIVE | -          | Running     | cf2-net=192.168.1.8                |
| 37668959-b98d-434c-87d7-ff6d9b5c090e | vm-2706cfc5-6449-4ad8-a65f-eead00930b53 | ACTIVE | -          | Running     | cf2-net=192.168.2.54               |
| 612829c6-3ef0-47b9-b055-17cc9b580e75 | vm-3bcf1e0e-0138-48a8-a828-fe27ca51e3c3 | ACTIVE | -          | Running     | cf2-net=192.168.3.36               |
| dee61e5b-0f14-46ec-90f8-019c9625d080 | vm-4b333e87-0051-4849-9931-d42f6e014496 | ACTIVE | -          | Running     | cf2-net=192.168.1.15               |
| d085379b-bb6f-402a-9c82-3b30369d765a | vm-5260b7a7-d3a6-4431-b12c-7bee9e77aa63 | ACTIVE | -          | Running     | cf2-net=192.168.3.34               |
| 3a32b5bb-6d03-45be-bf71-d0651d7c4d09 | vm-5f54b58b-4211-49ac-8088-b4a1d34f91d6 | ACTIVE | -          | Running     | cf2-net=192.168.1.5                |
| 3722a7ba-f858-4768-bd30-174939c6a176 | vm-67db8d18-a595-45ee-89ca-8dc0a090c792 | ACTIVE | -          | Running     | cf2-net=192.168.1.33               |
| 8125808c-54d6-44bf-8ea4-56b8bf041179 | vm-6eae9941-df97-4ecc-9122-d7088db47466 | ACTIVE | -          | Running     | cf2-net=192.168.2.56               |
| 2519e48a-db9f-40a4-a7e2-cd720f1e7ed8 | vm-6f2d310e-9f4b-4873-bb26-2de409d89ff1 | ACTIVE | -          | Running     | cf2-net=192.168.2.52               |
| 5b2bc775-36a9-4db9-8f75-7985bff02171 | vm-7ba4ad80-d219-4147-a27e-6a6039ccd64b | ACTIVE | -          | Running     | cf2-net=192.168.2.53               |
| e62947d4-5b4b-413c-9fbc-cfdbff58e798 | vm-7e3d97b6-16a8-4a8c-bcd7-4b76c49c461e | ACTIVE | -          | Running     | cf2-net=192.168.1.36               |
| 38ddf70b-154d-49a8-a032-31a3233c6638 | vm-80c5a161-bbd9-4aad-b43a-eba58c95eb27 | ACTIVE | -          | Running     | cf2-net=192.168.1.35               |
| 3ef0d127-3699-498c-9560-677741a8234b | vm-8d41fb50-466a-443d-9779-3ad8e7647d64 | ACTIVE | -          | Running     | cf2-net=192.168.3.35               |
| c5d852da-7cbc-4a60-b1e8-df17bf1386aa | vm-90e6708d-a766-40b5-af8c-e8e286a6f545 | ACTIVE | -          | Running     | cf2-net=192.168.3.33               |
| dcc0fd93-f234-4125-91a3-6a0eccd647c4 | vm-b6a25089-0f23-4204-8124-d52515fb433d | ACTIVE | -          | Running     | cf2-net=192.168.2.51               |
| 162909db-4e9a-4ea9-a4f7-978e2e22807f | vm-b99a3675-dc85-44d0-83cc-7a5e88e7572e | ACTIVE | -          | Running     | cf2-net=192.168.1.3, XXX.XX.XX.YY  |
| 09ed9008-16ff-4e80-a162-328a467bf404 | vm-bb9dbd16-27bc-4fc8-be3c-ed345110c3c4 | ACTIVE | -          | Running     | cf2-net=192.168.1.34               |
| 40622890-7f1d-4710-baa0-f224280c5cde | vm-c4c27dad-e045-4e7a-8ee6-ac1d58799d6c | ACTIVE | -          | Running     | cf2-net=192.168.3.31               |
| e14523bb-fcd2-45d9-af12-99c93a81040f | vm-d81f15a8-fd3c-4959-82e2-cebf05e2ada2 | ACTIVE | -          | Running     | cf2-net=192.168.1.32               |
| c1bd8f7a-0e1c-4ef8-a98d-6d6be440b28b | vm-dfca4ef5-170f-4c35-9749-117ef26c92b2 | ACTIVE | -          | Running     | cf2-net=192.168.1.11               |
| a0ed6f75-6efd-4b97-8aed-06e2da336969 | vm-e3f5fa24-ce5d-428b-b32c-b193a1561ff3 | ACTIVE | -          | Running     | cf2-net=192.168.2.55               |
| 5cf33530-d4a7-4eda-9519-f76052da23a1 | vm-f67420bb-eb12-49fd-ab1f-d4ff54a8edc2 | ACTIVE | -          | Running     | cf2-net=192.168.3.32               |
+--------------------------------------+-----------------------------------------+--------+------------+-------------+------------------------------------+

Is this a new setup or did you upgrade your Director from a previous version?

I deleted the old director and then recreated the director using the cpi v23. After that, I uploaded and deployed the CF release.

So what you did was bosh-init delete followed by bosh-init deploy?

I deleted the old deployment and releases before destroying and constructing the new director

Did the previous Director already have Cloud Foundry deployed?

Yes, but I deleted the deployment and release

Are you sure that new VMs got created when you deployed Cloud Foundry, or was the deployment merely an update of properties on existing VMs?

Yes, I am sure as I have deleted the deployments and redeployed cloud foundry several times after creating the director.

I have attached the bosh deployment manifest and cloud foundry manifest stub that I used for my deployments.

cf_redacted.yml.txt

bosh_redacted.yml.txt

cf-gitbot commented 8 years ago

We have created an issue in Pivotal Tracker to manage this. You can view the current status of your issue at: https://www.pivotaltracker.com/story/show/115016935.

voelzmo commented 8 years ago

Thanks @malik-altaf the manifests look good so far. Could you also give me a redacted output of bosh task <TASK_ID> --debug, where TASK_ID is the task with which you deployed CF? The log is quite long, so you might want to put it into a gist or upload it somewhere else.

Seems like the metadata didn't get set correctly, so we should be able to find something in the log. Also, could you do a nova show on one of the CF vms and paste the details here? I'm specifically interested in the metadata part here.

Thanks!

malik-altaf commented 8 years ago

Thanks @voelzmo, Please find the bosh director logs at public gist https://gist.github.com/malik-altaf/e947856aff54bf048676

The details of API vm are given below:

[ubuntu@bosh-cli my-bosh(keystone_cf-admin2)]$ nova show 162909db-4e9a-4ea9-a4f7-978e2e22807f
+--------------------------------------+----------------------------------------------------------------------------------+
| Property                             | Value                                                                            |
+--------------------------------------+----------------------------------------------------------------------------------+
| OS-DCF:diskConfig                    | AUTO                                                                             |
| OS-EXT-AZ:availability_zone          | cloud-cf-az2                                                                     |
| OS-EXT-STS:power_state               | 1                                                                                |
| OS-EXT-STS:task_state                | -                                                                                |
| OS-EXT-STS:vm_state                  | active                                                                           |
| OS-SRV-USG:launched_at               | 2016-02-23T06:36:31.000000                                                       |
| OS-SRV-USG:terminated_at             | -                                                                                |
| accessIPv4                           |                                                                                  |
| accessIPv6                           |                                                                                  |
| cf2-net network                      | 192.168.1.3, 137.172.74.67                                                       |
| config_drive                         |                                                                                  |
| created                              | 2016-02-23T06:36:21Z                                                             |
| flavor                               | m1.medium (19add635-0a87-41ea-96fa-3858074750d8)                                 |
| hostId                               | 0c23c6d474e4639181057ca5725dd844d21a482086058c1dd30b9b44                         |
| id                                   | 162909db-4e9a-4ea9-a4f7-978e2e22807f                                             |
| image                                | BOSH-6e550113-bf22-4859-a2da-a258761a0502 (21397150-c9d2-4a0e-b39e-82ebdb682c1b) |
| key_name                             | cf-keypair2                                                                      |
| metadata                             | {"director": "my-bosh", "index": "0", "job": "ha_proxy_z1", "deployment": "cf"}  |
| name                                 | vm-b99a3675-dc85-44d0-83cc-7a5e88e7572e                                          |
| os-extended-volumes:volumes_attached | []                                                                               |
| progress                             | 0                                                                                |
| security_groups                      | bosh, cf-private, cf-public, default                                             |
| status                               | ACTIVE                                                                           |
| tenant_id                            | cf01b8d9b4f44b4a9fe694207cced4aa                                                 |
| updated                              | 2016-02-23T06:36:31Z                                                             |
| user_id                              | 7032b448d8f34bae9c62eec932570233                                                 |
+--------------------------------------+----------------------------------------------------------------------------------+
voelzmo commented 8 years ago

Hi @malik-altaf

thanks for the additional logs. I cannot find a specific http call every installation of the OpenStack CPI in version >=23 should make, so I'm not sure if those VMs have really been created with the CPI in that version.

Furthermore, the OpenStack nova output from above shows that the VM was created on 2016-02-23T06:36:21Z. Did you create your Director before or after that date?

malik-altaf commented 8 years ago

Hi @voelzmo , I created the bosh director on 2016/02/21 and I have bosh-init logs on that date showing CPI 23 and human_readable_vm_names: true

voelzmo commented 8 years ago

Hey @malik-altaf

I just realized that your Director manifest contains

properties:
  director:
    director.cpi_job: openstack_cpi

It actually should be

properties:
  director:
    cpi_job: openstack_cpi

as stated on bosh.io.

Right now, your Director uses the internal OpenStack CPI rubygem, which is deprecated and outdated.

malik-altaf commented 8 years ago

Thanks @voelzmo, I'll try that out when I redeploy my cloud foundry and let you know if there is any issue.

malik-altaf commented 8 years ago

Hi @voelzmo, I can confirm that after fixing the manifest file, VMs are being created with human readable names. Thanks for your help.