Skip to content

Cannot configure director when vm-extensions are in-use #584

@diego-fidalgo

Description

@diego-fidalgo

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:

extensionsToDelete, err := c.addNewExtensions(currentExtensions, config.VMExtensions)
If a tile depends on a vm-extension, it cannot be deleted, thus configure-director commands fails.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions