cloudfoundry-attic / bosh-init

bosh-init is a tool used to create and update the Director VM
Apache License 2.0
31 stars 33 forks source link

RuntimeError: Could not find cloud plugin #57

Closed pako-grape closed 8 years ago

pako-grape commented 8 years ago

I have following manifest file:


---
name: bosh
releases:
- name: bosh
  url: https://bosh.io/d/github.com/cloudfoundry/bosh?v=215
  sha1: f86d4cec1baff641287e069619d7ed4dfa578b13
- name: bosh-openstack-cpi
  url: https://bosh.io/d/github.com/cloudfoundry-incubator/bosh-openstack-cpi-release?v=15
  sha1: 5d92bc58c23e95745c17fa768566e061327b9367
resource_pools:
- name: vms
  network: private
  stemcell:
    url: https://bosh.io/d/stemcells/bosh-openstack-kvm-ubuntu-trusty-go_agent?v=3012
    sha1: e92f3bd5081301652005bdc3dd11bff545a304ef
  cloud_properties:
    instance_type: 1C-2GB-50GB
disk_pools:
- name: disks
  disk_size: 20_000
networks:
- name: private
  type: manual
  subnets:
  - range: 10.0.0.0/24 # <--- Replace with a private subnet CIDR
    gateway: 10.0.0.1 # <--- Replace with a private subnet's gateway
    dns: [8.8.8.8] # <--- Replace with your DNS
    cloud_properties: {net_id: MY_PRIVATE_NETWORK_ID} # <--- # Replace with private network UUID
- name: public
  type: vip
jobs:
- name: bosh
  instances: 1
  templates:
  - {name: nats, release: bosh}
  - {name: redis, release: bosh}
  - {name: postgres, release: bosh}
  - {name: blobstore, release: bosh}
  - {name: director, release: bosh}
  - {name: health_monitor, release: bosh}
  - {name: registry, release: bosh}
  - {name: cpi, release: bosh-openstack-cpi}
  resource_pool: vms
  persistent_disk_pool: disks
  networks:
  - name: private
    static_ips: [10.0.0.10] # <--- Replace with a private IP
    default: [dns, gateway]
  - name: public
    static_ips: [MY_FLOATING_IP] # <--- Replace with a floating IP
  properties:
    nats:
      address: 127.0.0.1
      user: nats
      password: nats-password
    redis:
      listen_address: 127.0.0.1
      address: 127.0.0.1
      password: redis-password
    postgres: &db
      listen_address: 127.0.0.1
      host: 127.0.0.1
      user: postgres
      password: postgres-password
      database: bosh
      adapter: postgres
    registry:
      address: 10.0.0.10 # <--- Replace with a private IP
      host: 10.0.0.10 # <--- Replace with a private IP
      db: *db
      http: {user: admin, password: admin, port: 25777}
      username: admin
      password: admin
      port: 25777
    blobstore:
      address: 10.0.0.10 # <--- Replace with a private IP
      port: 25250
      provider: dav
      director: {user: director, password: director-password}
      agent: {user: agent, password: agent-password}
    director:
      address: 127.0.0.1
      name: my-bosh
      db: *db
      cpi_job: cpi
      max_threads: 3
      user_management:
        provider: local
        local:
          users:
          - {name: admin, password: admin}
          - {name: hm, password: hm-password}
    hm:
      director_account: {user: hm, password: hm-password}
      resurrector_enabled: true
    openstack: &openstack
      auth_url: https://identity1.citycloud.com:5000/v3/ # <--- Replace with OpenStack Identity API endpoint
      project: MY_PROJECT_NAME # <--- Replace with OpenStack tenant name
      username: MY_USERNAME # <--- Replace with OpenStack username
      api_key: MY_PASSWORD # <--- Replace with OpenStack password
      default_key_name: grape
      default_security_groups: [open]
      domain: MY_DOMAIN_NAME
      region: Lon1
    agent: {mbus: "nats://nats:nats-password@10.0.0.10:4222"} # <--- Replace with a private IP
    ntp: &ntp [0.pool.ntp.org, 1.pool.ntp.org]
cloud_provider:
  template: {name: cpi, release: bosh-openstack-cpi}
  ssh_tunnel:
    host: MY_FLOATING_IP # <--- Replace with a floating IP
    port: 22
    user: vcap
    private_key: ./grape.pem # Path relative to this manifest file
  mbus: "https://mbus:mbus-password@MY_FLOATING_IP:6868" # <--- Replace with a floating IP
  properties:
    openstack: *openstack
    agent: {mbus: "https://mbus:mbus-password@0.0.0.0:6868"}
    blobstore: {provider: local, path: /var/vcap/micro_bosh/data/cache}
    ntp: *ntp

When running bosh-init deploy bosh.yml: 1) Virtual machine with bosh is created 2) Additional disk is attached 3) Error:

[main] 2015/11/18 14:09:30 ERROR - Command 'deploy' failed: Deploying: Building state for instance 'bosh/0': Rendering job templates for instance 'bosh/0': Rendering templates for job 'registry/e1c8281e38f4f36aa17f15deecd952c711480736': Rendering template src: registry.yml.erb, dst: config/registry.yml: Rendering template src: /home/pawel/.bosh_init/installations/2e68c4ed-b6ba-4bc5-53b5-085fb21ced63/tmp/bosh-init-release791564600/extracted_jobs/registry/templates/registry.yml.erb, dst: /home/pawel/.bosh_init/installations/2e68c4ed-b6ba-4bc5-53b5-085fb21ced63/tmp/rendered-jobs812434315/config/registry.yml: Running ruby to render templates: Running command: 'ruby /home/pawel/.bosh_init/installations/2e68c4ed-b6ba-4bc5-53b5-085fb21ced63/tmp/erb-renderer965315061/erb-render.rb /home/pawel/.bosh_init/installations/2e68c4ed-b6ba-4bc5-53b5-085fb21ced63/tmp/erb-renderer965315061/erb-context.json /home/pawel/.bosh_init/installations/2e68c4ed-b6ba-4bc5-53b5-085fb21ced63/tmp/bosh-init-release791564600/extracted_jobs/registry/templates/registry.yml.erb /home/pawel/.bosh_init/installations/2e68c4ed-b6ba-4bc5-53b5-085fb21ced63/tmp/rendered-jobs812434315/config/registry.yml', stdout: '', stderr: '/home/pawel/.bosh_init/installations/2e68c4ed-b6ba-4bc5-53b5-085fb21ced63/tmp/erb-renderer965315061/erb-render.rb:180:in `rescue in render': Error filling in template '/home/pawel/.bosh_init/installations/2e68c4ed-b6ba-4bc5-53b5-085fb21ced63/tmp/bosh-init-release791564600/extracted_jobs/registry/templates/registry.yml.erb' for registry/0 (line 73: #<RuntimeError: Could not find cloud plugin>) (RuntimeError)
    from /home/pawel/.bosh_init/installations/2e68c4ed-b6ba-4bc5-53b5-085fb21ced63/tmp/erb-renderer965315061/erb-render.rb:166:in `render'
    from /home/pawel/.bosh_init/installations/2e68c4ed-b6ba-4bc5-53b5-085fb21ced63/tmp/erb-renderer965315061/erb-render.rb:191:in `<main>'
': exit status 1

Command 'deploy' failed:
  Deploying:
    Building state for instance 'bosh/0':
      Rendering job templates for instance 'bosh/0':
        Rendering templates for job 'registry/e1c8281e38f4f36aa17f15deecd952c711480736':
          Rendering template src: registry.yml.erb, dst: config/registry.yml:
            Rendering template src: /home/pawel/.bosh_init/installations/2e68c4ed-b6ba-4bc5-53b5-085fb21ced63/tmp/bosh-init-release791564600/extracted_jobs/registry/templates/registry.yml.erb, dst: /home/pawel/.bosh_init/installations/2e68c4ed-b6ba-4bc5-53b5-085fb21ced63/tmp/rendered-jobs812434315/config/registry.yml:
              Running ruby to render templates:
                Running command: 'ruby /home/pawel/.bosh_init/installations/2e68c4ed-b6ba-4bc5-53b5-085fb21ced63/tmp/erb-renderer965315061/erb-render.rb /home/pawel/.bosh_init/installations/2e68c4ed-b6ba-4bc5-53b5-085fb21ced63/tmp/erb-renderer965315061/erb-context.json /home/pawel/.bosh_init/installations/2e68c4ed-b6ba-4bc5-53b5-085fb21ced63/tmp/bosh-init-release791564600/extracted_jobs/registry/templates/registry.yml.erb /home/pawel/.bosh_init/installations/2e68c4ed-b6ba-4bc5-53b5-085fb21ced63/tmp/rendered-jobs812434315/config/registry.yml', stdout: '', stderr: '/home/pawel/.bosh_init/installations/2e68c4ed-b6ba-4bc5-53b5-085fb21ced63/tmp/erb-renderer965315061/erb-render.rb:180:in `rescue in render': Error filling in template '/home/pawel/.bosh_init/installations/2e68c4ed-b6ba-4bc5-53b5-085fb21ced63/tmp/bosh-init-release791564600/extracted_jobs/registry/templates/registry.yml.erb' for registry/0 (line 73: #<RuntimeError: Could not find cloud plugin>) (RuntimeError)
    from /home/pawel/.bosh_init/installations/2e68c4ed-b6ba-4bc5-53b5-085fb21ced63/tmp/erb-renderer965315061/erb-render.rb:166:in `render'
    from /home/pawel/.bosh_init/installations/2e68c4ed-b6ba-4bc5-53b5-085fb21ced63/tmp/erb-renderer965315061/erb-render.rb:191:in `<main>'
':
                  exit status 1
allomov commented 8 years ago

Hey, Pawel.

Looks like registry.yml.erb of your version of BOSH expects you to have following properties in your properties.openstack section:

properties:
  openstack:
    auth_url: ...
    username: ...
    api_key:  ...
    tenant:   ...

I am sure that you need to change project field name to tenant in your manifest and it should fix the issue.

allomov commented 8 years ago

In the same time the latest version of BOSH accepts both tenant and project, so you can also update version of BOSH possibly (which I would not recommend because lots of existing manifest generators are not compliant with some state of the art BOSH features).

pako-grape commented 8 years ago

wow, I never thought that this could be the reason... Thanks a lot! I have 1.3104.0 bosh version and when I replaced project to tenant there was an error about lack of 'project' property. Finally when I specify both project and tenant everything is OK. Thanks a lot again:)