om icon indicating copy to clipboard operation
om copied to clipboard

Cannot configure director when vm-extensions are in-use

Open diego-fidalgo opened this issue 2 years ago • 1 comments

Steps to reproduce

  1. Create a vm-extension by using om create-vm-extension.
  2. Configure that vm-extension in the tiles resources configuration.
  3. Apply the changes in om.
  4. Run om configure-director

Expected

om configure-director should work well as we are not changing anything:

started setting iaas configurations for bosh tile
finished setting iaas configurations for bosh tile
started configuring director options for bosh tile
finished configuring director options for bosh tile
started configuring availability zone options for bosh tile
successfully fetched AZs, continuing
finished configuring availability zone options for bosh tile
started configuring network options for bosh tile
finished configuring network options for bosh tile
started configuring network assignment options for bosh tile
finished configuring network assignment options for bosh tile
started configuring vm extensions
applying vmextensions configuration for the following:
finished configuring vm extensions
started configuring resource options for bosh tile
finished configuring resource options for bosh tile

Actual

om configure-director fails because it cannot delete a vm-extension that is being used:

started setting iaas configurations for bosh tile
finished setting iaas configurations for bosh tile
started configuring director options for bosh tile
finished configuring director options for bosh tile
started configuring availability zone options for bosh tile
successfully fetched AZs, continuing
finished configuring availability zone options for bosh tile
started configuring network options for bosh tile
finished configuring network options for bosh tile
started configuring network assignment options for bosh tile
unable to set network assignment for director as it has already been deployed
finished configuring network assignment options for bosh tile
started configuring vm extensions
applying vmextensions configuration for the following:
deleting vm extension cloud-controller-iam

2022/05/11 10:10:55 request failed: unexpected response from /api/v0/staged/vm_extensions/cloud-controller-iam:
HTTP/1.1 422 Unprocessable Entity
Transfer-Encoding: chunked
Cache-Control: no-cache, no-store
Connection: keep-alive
Content-Type: application/json; charset=utf-8
Date: Wed, 11 May 2022 10:10:54 GMT
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Pragma: no-cache
Referrer-Policy: strict-origin-when-cross-origin
Server: Ops Manager
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-Request-Id: 9783ed63-fafb-43c7-8625-662e86c70905
X-Runtime: 0.169166
X-Xss-Protection: 1; mode=block
151
{"errors":{"vm_extension":["cf-1c43a429818fdf4e22ca is using \"cloud-controller-iam\" in vm_extensions","cf-1c43a429818fdf4e22ca is using \"cloud-controller-iam\" in vm_extensions","cf-1c43a429818fdf4e22ca is using \"cloud-controller-iam\" in vm_extensions","cf-1c43a429818fdf4e22ca is using \"cloud-controller-iam\" in vm_extensions"]}}
0

Notes After taking a look into the code, we think that the problematic part is here: https://github.com/pivotal-cf/om/blob/2aeff1d15cfe3e192567098afc107d718110b33f/commands/configure_director.go#L435 If a tile depends on a vm-extension, it cannot be deleted, thus configure-director commands fails.

diego-fidalgo avatar May 11 '22 10:05 diego-fidalgo

We have created an issue in Pivotal Tracker to manage this. Unfortunately, the Pivotal Tracker project is private so you may be unable to view the contents of the story.

The labels on this github issue will be updated when the story is started.

cf-gitbot avatar May 11 '22 10:05 cf-gitbot