cloudfoundry / bosh

Cloud Foundry BOSH is an open source tool chain for release engineering, deployment and lifecycle management of large scale distributed services.
https://bosh.io
Apache License 2.0
2.04k stars 657 forks source link

microbosh deploy bosh fail ! help me,thanks #819

Closed tsxyz closed 9 years ago

tsxyz commented 9 years ago

use vsphere

lishuai@lishuai-virtual-machine:~/my-micro-deployment$ bosh deployment /home/lishuai/download/manifest.yml
Deployment set to `/home/lishuai/download/manifest.yml'
lishuai@lishuai-virtual-machine:~/my-micro-deployment$ bosh deploy                      

Processing deployment manifest
------------------------------
Getting deployment properties from director...
Unable to get properties list from director, trying without it...
Compiling deployment manifest...
Cannot get current deployment information from director, possibly a new deployment
Please review all changes carefully

Deploying
---------
Deployment name: `manifest.yml'
Director name: `microbosh'
Are you sure you want to deploy? (type 'yes' to continue): yes

Director task 7
Error 40000: Object ("blobstore") did not match the required type `Hash'

Task 7 error

For a more detailed error report, run: bosh task 7 --debug
lishuai@lishuai-virtual-machine:~/my-micro-deployment$ bosh task 7 --debug

Director task 7
I, [2015-05-04T09:49:00.147183 #1454] [0x3f9aae84b330]  INFO -- TaskHelper: Director Version: 1.2941.0
I, [2015-05-04T09:49:00.147222 #1454] [0x3f9aae84b330]  INFO -- TaskHelper: Enqueuing task: 7
I, [2015-05-04 09:49:02 #2827] []  INFO -- DirectorJobRunner: Looking for task with task id 7
D, [2015-05-04 09:49:02 #2827] [] DEBUG -- DirectorJobRunner: (0.000783s) SELECT * FROM "tasks" WHERE "id" = 7
I, [2015-05-04 09:49:02 #2827] []  INFO -- DirectorJobRunner: Starting task: 7
I, [2015-05-04 09:49:02 #2827] [task:7]  INFO -- DirectorJobRunner: Creating job
I, [2015-05-04 09:49:02 #2827] [task:7]  INFO -- DirectorJobRunner: Reading deployment manifest
D, [2015-05-04 09:49:02 #2827] [task:7] DEBUG -- DirectorJobRunner: Manifest:

---
name: bosh2
director_uuid: 227dd7bc-7c0f-4b56-bf73-c95faf511ef5
release:
  name: bosh
  version: 106
networks:
- name: default
  subnets:
  - range: 150.0.0.0/8
    gateway: 150.254.254.254
    static:
    - 150.0.3.110 - 150.0.3.200
    reserved:
    - 150.0.3.2 - 150.0.3.109
    - 150.0.3.201 - 150.0.3.254
    dns:
    - 8.8.8.8
    cloud_properties:
      name: VM Network
resource_pools:
- name: default
  stemcell:
    name: bosh-vsphere-esxi-ubuntu-trusty-go_agent
    version: 2950
  network: default
  cloud_properties:
    cpu: 2
    ram: 512
    disk: 8000
compilation:
  reuse_compilation_vms: true
  workers: 1
  network: default
  cloud_properties:
    ram: 512
    disk: 6000
    cpu: 2
update:
  canaries: 1
  canary_watch_time: 30000-90000
  update_watch_time: 30000-90000
  max_in_flight: 1
jobs:
- name: bosh_data
  templates:
  - blobstore
  - postgres
  - redis
  instances: 1
  resource_pool: default
  persistent_disk: 8000
  networks:
  - name: default
    static_ips:
    - 150.0.3.121
- name: bosh_api
  templates:
  - nats
  - director
  - health_monitor
  - powerdns
  instances: 1
  resource_pool: default
  networks:
  - name: default
    static_ips:
    - 150.0.3.122
properties:
  ntp:
  - pool.ntp.org
  nats:
    user: nats
    password: nats-password
    address: 150.0.3.122
    port: 4222
  blobstore:
    address: 150.0.3.121
    port: 25251
    backend_port: 25552
    agent:
      user: admin
      password: admin
    director:
      user: admin
      password: admin
  postgres: &21305440
    user: bosh
    password: bosh-password
    host: 150.0.3.121
    port: 5432
    database: bosh
  redis:
    password: redis-password
    address: 150.0.3.121
    port: 25255
  director:
    name: bosh2
    address: 150.0.3.122
    port: 25555
    encryption: false
    enable_snapshots: true
    max_tasks: 100
    db: *21305440
  hm:
    http:
      port: 25923
      user: admin
      password: admin-password
    director_account:
      user: admin
      password: admin-password
    intervals:
      poll_director: 60
      poll_grace_period: 30
      log_stats: 300
      analyze_agents: 60
      agent_timeout: 180
      rogue_agent_alert: 180
    loglevel: info
    email_notifications: false
    tsdb_enabled: false
    cloud_watch_enabled: false
    resurrector_enabled: true
  dns:
    address: 150.0.3.122
    recursor: 8.8.8.8
    db: *21305440
  vcenter:
    address: 130.0.3.1
    user: root
    password: vmware
    datacenters:
    - name: cloud foundry
      vm_folder: vm_folder
      template_folder: template_folder
      disk_path: boshdeployer
      datastore_pattern: datastore1
      persistent_datastore_pattern: datastore1
      allow_mixed_datastores: true
      clusters:
      - cf150:
          resource_pool: default

D, [2015-05-04 09:49:02 #2827] [task:7] DEBUG -- DirectorJobRunner: (0.000303s) SELECT * FROM "cloud_configs" WHERE ("id" IS NULL) LIMIT 1
D, [2015-05-04 09:49:02 #2827] [task:7] DEBUG -- DirectorJobRunner: Cloud Config:
nil
I, [2015-05-04 09:49:02 #2827] [task:7]  INFO -- DirectorJobRunner: Creating deployment plan
I, [2015-05-04 09:49:02 #2827] [task:7]  INFO -- DirectorJobRunner: Deployment plan options: {}

E, [2015-05-04 09:49:42 #2827] [task:7] ERROR -- DirectorJobRunner: Object ("blobstore") did not match the required type `Hash'
/var/vcap/packages/director/gem_home/ruby/2.1.0/gems/bosh-director-1.2941.0/lib/bosh/director/validation_helper.rb:7:in `safe_property'
/var/vcap/packages/director/gem_home/ruby/2.1.0/gems/bosh-director-1.2941.0/lib/bosh/director/deployment_plan/job_spec_parser.rb:114:in `block in parse_templates'
/var/vcap/packages/director/gem_home/ruby/2.1.0/gems/bosh-director-1.2941.0/lib/bosh/director/deployment_plan/job_spec_parser.rb:113:in `each'
/var/vcap/packages/director/gem_home/ruby/2.1.0/gems/bosh-director-1.2941.0/lib/bosh/director/deployment_plan/job_spec_parser.rb:113:in `parse_templates'
/var/vcap/packages/director/gem_home/ruby/2.1.0/gems/bosh-director-1.2941.0/lib/bosh/director/deployment_plan/job_spec_parser.rb:30:in `parse'
/var/vcap/packages/director/gem_home/ruby/2.1.0/gems/bosh-director-1.2941.0/lib/bosh/director/deployment_plan/job.rb:79:in `parse'
/var/vcap/packages/director/gem_home/ruby/2.1.0/gems/bosh-director-1.2941.0/lib/bosh/director/deployment_plan/deployment_spec_parser.rb:130:in `block in parse_jobs'
/var/vcap/packages/director/gem_home/ruby/2.1.0/gems/bosh-director-1.2941.0/lib/bosh/director/deployment_plan/deployment_spec_parser.rb:124:in `each'
/var/vcap/packages/director/gem_home/ruby/2.1.0/gems/bosh-director-1.2941.0/lib/bosh/director/deployment_plan/deployment_spec_parser.rb:124:in `parse_jobs'
/var/vcap/packages/director/gem_home/ruby/2.1.0/gems/bosh-director-1.2941.0/lib/bosh/director/deployment_plan/deployment_spec_parser.rb:31:in `parse'
/var/vcap/packages/director/gem_home/ruby/2.1.0/gems/bosh-director-1.2941.0/lib/bosh/director/deployment_plan/planner.rb:58:in `parse'
/var/vcap/packages/director/gem_home/ruby/2.1.0/gems/bosh-director-1.2941.0/lib/bosh/director/jobs/update_deployment.rb:37:in `initialize'
/var/vcap/packages/director/gem_home/ruby/2.1.0/gems/bosh-director-1.2941.0/lib/bosh/director/job_runner.rb:93:in `new'
/var/vcap/packages/director/gem_home/ruby/2.1.0/gems/bosh-director-1.2941.0/lib/bosh/director/job_runner.rb:93:in `perform_job'
/var/vcap/packages/director/gem_home/ruby/2.1.0/gems/bosh-director-1.2941.0/lib/bosh/director/job_runner.rb:31:in `block in run'
/var/vcap/packages/director/gem_home/ruby/2.1.0/gems/bosh_common-1.2941.0/lib/common/thread_formatter.rb:49:in `with_thread_name'
/var/vcap/packages/director/gem_home/ruby/2.1.0/gems/bosh-director-1.2941.0/lib/bosh/director/job_runner.rb:31:in `run'
/var/vcap/packages/director/gem_home/ruby/2.1.0/gems/bosh-director-1.2941.0/lib/bosh/director/jobs/base_job.rb:10:in `perform'
/var/vcap/packages/director/gem_home/ruby/2.1.0/gems/resque-1.25.2/lib/resque/job.rb:227:in `perform'
/var/vcap/packages/director/gem_home/ruby/2.1.0/gems/resque-1.25.2/lib/resque/worker.rb:250:in `perform'
/var/vcap/packages/director/gem_home/ruby/2.1.0/gems/resque-1.25.2/lib/resque/worker.rb:189:in `block in work'
/var/vcap/packages/director/gem_home/ruby/2.1.0/gems/resque-1.25.2/lib/resque/worker.rb:166:in `loop'
/var/vcap/packages/director/gem_home/ruby/2.1.0/gems/resque-1.25.2/lib/resque/worker.rb:166:in `work'
/var/vcap/packages/director/gem_home/ruby/2.1.0/gems/bosh-director-1.2941.0/bin/bosh-director-worker:75:in `<top (required)>'
/var/vcap/packages/director/bin/bosh-director-worker:16:in `load'
/var/vcap/packages/director/bin/bosh-director-worker:16:in `<main>'
D, [2015-05-04 09:49:42 #2827] [task:7] DEBUG -- DirectorJobRunner: (0.000116s) BEGIN
D, [2015-05-04 09:49:42 #2827] [task:7] DEBUG -- DirectorJobRunner: (0.000256s) UPDATE "tasks" SET "state" = 'error', "timestamp" = '2015-05-04 09:49:42.356927+0000', "description" = 'create deployment', "result" = 'Object ("blobstore") did not match the required type `Hash''', "output" = '/var/vcap/store/director/tasks/7', "checkpoint_time" = '2015-05-04 09:49:00.144259+0000', "type" = 'update_deployment', "username" = 'admin' WHERE ("id" = 7)
D, [2015-05-04 09:49:42 #2827] [task:7] DEBUG -- DirectorJobRunner: (0.000462s) COMMIT
I, [2015-05-04 09:49:42 #2827] []  INFO -- DirectorJobRunner: Task took 40.286363492 seconds to process.

Task 7 error

my manifest.yml


---
name: bosh2

director_uuid: 395227ab-3747-4504-8a61-dc75e9bf2f6a

release: {name: bosh, version: 106}

networks:
- name: default
  subnets:
  - range: 150.0.0.0/8
    gateway: 150.254.254.254
    static:
    - 150.0.3.110 - 150.0.3.200
    reserved:
    # .1 is special
    - 150.0.3.2 - 150.0.3.109
    - 150.0.3.201 - 150.0.3.254
    # .255 is special
    dns: [8.8.8.8]
    cloud_properties:
      name: 'VM Network'

resource_pools:
- name: default
  stemcell:
    name: bosh-vsphere-esxi-ubuntu-trusty-go_agent 
    version: 2950
  network: default
  cloud_properties:
    cpu: 2
    ram: 512
    disk: 8_000

compilation:
  reuse_compilation_vms: true
  workers: 1
  network: default
  cloud_properties:
    ram: 512
    disk: 6_000
    cpu: 2

update:
  canaries: 1
  canary_watch_time: 30000-90000
  update_watch_time: 30000-90000
  max_in_flight: 1

jobs:
- name: bosh_data
  templates: [blobstore, postgres, redis]
  instances: 1
  resource_pool: default
  persistent_disk: 8_000
  networks:
  - name: default
    static_ips: [150.0.3.121]

- name: bosh_api
  templates: [nats, director, health_monitor, powerdns]
  instances: 1
  resource_pool: default
  networks:
  - name: default
    static_ips: [150.0.3.122]

properties:
  ntp: ["pool.ntp.org"]

  nats:
    user: nats
    password: nats-password
    address: 150.0.3.122
    port: 4222

  blobstore:
    address: 150.0.3.121
    port: 25251
    backend_port: 25552
    agent:
      user: agent
      password: agent-password
    director:
      user: director
      password: director-password

  postgres: &bosh_db
    user: bosh
    password: bosh-password
    host: 150.0.3.121
    port: 5432
    database: bosh

  redis:
    password: redis-password
    address: 150.0.3.121
    port: 25255

  director:
    name: bosh2
    address: 150.0.3.122
    port: 25555
    encryption: false
    # Check if the CPI for your IaaS supports snapshots, otherwise disable it.
    # As an example vCloud CPI 0.5.2 does not support snapshots
    enable_snapshots: true
    max_tasks: 100
    db: *bosh_db
    # If needed, limit the number of threads used to concurrently instantiate new vms (32 by default)
    # max_threads: 1

  hm:
    http:
      port: 25923
      user: admin
      password: admin-password
    director_account:
      user: admin
      password: admin-password
    intervals:
      poll_director: 60
      poll_grace_period: 30
      log_stats: 300
      analyze_agents: 60
      agent_timeout: 180
      rogue_agent_alert: 180
    loglevel: info
    email_notifications: false
    tsdb_enabled: false
    cloud_watch_enabled: false
    resurrector_enabled: true

  dns:
    address: 150.0.3.122
    recursor: 8.8.8.8
    db: *bosh_db

  vcenter:
    address: 130.0.3.1
    user: root
    password: vmware
    datacenters:
      - name: cloud foundry
        vm_folder:       vm_folder
        template_folder: template_folder
        disk_path:       boshdeployer
        datastore_pattern:            datastore1
        persistent_datastore_pattern: datastore1
        allow_mixed_datastores: true
        clusters:
          - cf150:
              resource_pool: default

Please help me, thank you very much

cppforlife commented 9 years ago

As https://bosh.io/docs/deployment-manifest.html#jobs specifies templates key is an array of hashes. Btw we do recommend just to use single VM bosh created by the micro CLI plugin.