No valid placement found for VM compute and storage requirement when upgrading Opsman/BOSH
search cancel

No valid placement found for VM compute and storage requirement when upgrading Opsman/BOSH

book

Article ID: 293771

calendar_today

Updated On:

Products

Operations Manager

Issue/Introduction

When upgrading Opsman/BOSH and multiple vCenters are configured under the BOSH Tile -> vCenter Config, you may get the below error when deploying BOSH:
CPI 'create_vm' method responded with error: CmdError{"type":"Bosh::Clouds::CloudError","message":"No valid placement found for VM compute and storage requirement","ok_to_retry":false}
This can happen if the AZ selected for the BOSH director is not part of the first vCenter config.

For example:
  1. In BOSH Tile -> Assign AZs and Networks you have az1 selected.
  2. In BOSH Tile -> Create Availability Zones az1 has vCenter1 selected under IaaS Configuration
  3. In BOSH Tile -> vCenter Config vCenter1 is not the first config in the list
  4. This can cause the BOSH director to try to deploy with the wrong datastores. This is because it uses datastores from the first vCenter config in this list


Environment

Product Version: 2.10

Resolution

The workaround is to make the vCenter for BOSH the first vCenter config in BOSH Tile -> vCenter Config
  1. Take backup of Opsman installation: Account (Top Right) -> Settings -> Export Installation Settings
  2. SSH into Opsman and decrypt installation.yml and actual-installation.yml
    • cd /tmp
      
      sudo -u tempest-web SECRET_KEY_BASE="s" RAILS_ENV=production /home/tempest-web/tempest/web/scripts/decrypt /var/tempest/workspaces/default/installation.yml /tmp/installation.yml
      
      sudo -u tempest-web SECRET_KEY_BASE="s" RAILS_ENV=production /home/tempest-web/tempest/web/scripts/decrypt /var/tempest/workspaces/default/actual-installation.yml /tmp/actual-installation.yml
      
  3. Edit both installation.yml and actual-installation.yml and change the order of the vCenter configs under iaas_configurations
    • sudo vim /tmp/installation.yml
    • Below is an example iaas_configurations config. Note that vCenter1 is below vCenter2
    •   iaas_configurations:
        - guid: 9c994f88b56268c98846
          name: vCenter2
          vcenter_host: vCenter2.example.com
          vcenter_username: user2
          vcenter_password: password2
          datacenter: datacenter
          persistent_datastores:
          - datastore-2
          ephemeral_datastores:
          - datastore-2
          disk_type: thin
          ssl_verification_enabled: false
          nsx_networking_enabled: false
          nsx_mode: nsx-v
          nsx_t_auth_type: local_user
          nsx_t_use_policy_api: false
          bosh_vm_folder: pcf_vms2
          bosh_template_folder: pcf_templates2
          bosh_disk_path: pcf_disk2
          - guid: 432tfasdfa43504148
          name: vCenter1
          vcenter_host: vCenter1.example.com
          vcenter_username: user1
          vcenter_password: password1
          datacenter: datacenter
          persistent_datastores:
          - datastore-1
          ephemeral_datastores:
          - datastore-1
          disk_type: thin
          ssl_verification_enabled: false
          nsx_networking_enabled: false
          nsx_mode: nsx-v
          nsx_t_auth_type: local_user
          nsx_t_use_policy_api: false
          bosh_vm_folder: pcf_vms1
          bosh_template_folder: pcf_templates1
          bosh_disk_path: pcf_disk1
        icmp_checks_enabled: true
    • Change the order so that vCenter1 is the first vCenter config
    •   iaas_configurations:
        - guid: 432tfasdfa43504148
          name: vCenter1
          vcenter_host: vCenter1.example.com
          vcenter_username: user1
          vcenter_password: password1
          datacenter: datacenter
          persistent_datastores:
          - datastore-1
          ephemeral_datastores:
          - datastore-1
          disk_type: thin
          ssl_verification_enabled: false
          nsx_networking_enabled: false
          nsx_mode: nsx-v
          nsx_t_auth_type: local_user
          nsx_t_use_policy_api: false
          bosh_vm_folder: pcf_vms1
          bosh_template_folder: pcf_templates1
          bosh_disk_path: pcf_disk1
        - guid: 9c994f88b56268c98846
          name: vCenter2
          vcenter_host: vCenter2.example.com
          vcenter_username: user2
          vcenter_password: password2
          datacenter: datacenter
          persistent_datastores:
          - datastore-2
          ephemeral_datastores:
          - datastore-2
          disk_type: thin
          ssl_verification_enabled: false
          nsx_networking_enabled: false
          nsx_mode: nsx-v
          nsx_t_auth_type: local_user
          nsx_t_use_policy_api: false
          bosh_vm_folder: pcf_vms2
          bosh_template_folder: pcf_templates2
          bosh_disk_path: pcf_disk2
        icmp_checks_enabled: true
  4. Make the same change in actual-installation.yml
  5. Encrypt installation.yml and actual-installation.yml again
    • sudo -u tempest-web SECRET_KEY_BASE="s" RAILS_ENV=production /home/tempest-web/tempest/web/scripts/encrypt /tmp/installation.yml /var/tempest/workspaces/default/installation.yml
      
      sudo -u tempest-web SECRET_KEY_BASE="s" RAILS_ENV=production /home/tempest-web/tempest/web/scripts/encrypt /tmp/actual-installation.yml /var/tempest/workspaces/default/actual-installation.yml
  6. Restart tempest-web
    • sudo service tempest-web restart
  7. Log back into Opsman UI and verify the order changed under BOSH Tile -> vCenter Config
  8. Apply Changes and BOSH should deploy using the correct vCenter and datastores