Pivotal Knowledge Base

Follow

How to interact with blob store from the Ops Manager Director with blobstore_client_console

Environment 

Product Version
Pivotal Cloud Foundry® (PCF) 1.6.x, 1.7.x
Component Ops Manager Director

Purpose

This article explains how to troubleshoot blob store access from Bosh Director with the blobstore_console utility found in github at https://github.com/cloudfoundry/bosh/tree/master/blobstore_client. 

This should be useful when you want to test or troubleshoot interaction with the blob store from the Ops Manager Director in a vacuum. 

Note that this requires administrative access to your Pivotal Cloud Foundry deployment, namely, you need to be able to log on to the Bosh Director VM. 

Procedure

  1. Go to the Ops Manager Director tile in the Ops Manager web UI. 
  2. Remember the IP address and VM credentials found in the Status and Credentials tab respectively. 
  3. Connect via SSH into the director with vcap user and become root user by sudo -i.
  4. You can run the /var/vcap/bosh/bin/blobstore_client_console commandTake a look at the /var/vcap/jobs/director/config/director.yml config file to see how the director is configured to access the blob store.  

Here is an example of the relevant section of the /var/vcap/jobs/director/config/director.yml configuration file in v1.7:

{
    "blobstore": {
        "options": {
            "endpoint": "http://x.x.x.x:25250",
            "password": "password",
            "user": "blobstore"
        },
        "provider": "dav"
    },
... 

Create a yml configuration file for the blobstore_client_console command by extracting "blobstore.options" sections in the director.yml; an example is shown below:

---
"endpoint": "http://x.x.x.x:25250"
"password": "password"
"user": "blobstore"

Suppose you have the above configuration file in /tmp/bstest.yml, you can start the console with this command: 

/var/vcap/bosh/bin/blobstore_client_console -c /tmp/bstest.yml -p dav

Note that you pass the value of "blobstore.provider" in the director.yml  to -p option argument. 

Once you go into the console, you can test blob store access by invoking methods defined in blob store client interface like this:

irb(main):002:0> bsc.create('test data')
=> "30b42f42-05c3-4c2b-a39d-e02108f26ada"
irb(main):003:0> bsc.get('30b42f42-05c3-4c2b-a39d-e02108f26ada')
=> "test data"
irb(main):004:0> bsc.delete('30b42f42-05c3-4c2b-a39d-e02108f26ada')
=> nil
irb(main):005:0> bsc.get('30b42f42-05c3-4c2b-a39d-e02108f26ada')
Bosh::Blobstore::BlobstoreError: Could not fetch object, 404/
	from /var/vcap/bosh/lib/ruby/gems/1.9.1/gems/blobstore_client-1.3232.4.0/lib/blobstore_client/dav_blobstore_client.rb:51:in `get_file'
	from /var/vcap/bosh/lib/ruby/gems/1.9.1/gems/blobstore_client-1.3232.4.0/lib/blobstore_client/base.rb:55:in `block (2 levels) in get'
	from /var/vcap/bosh/lib/ruby/gems/1.9.1/gems/blobstore_client-1.3232.4.0/lib/blobstore_client/base.rb:55:in `open'
	from /var/vcap/bosh/lib/ruby/gems/1.9.1/gems/blobstore_client-1.3232.4.0/lib/blobstore_client/base.rb:55:in `block in get'
	from /var/vcap/bosh/lib/ruby/gems/1.9.1/gems/blobstore_client-1.3232.4.0/lib/blobstore_client/base.rb:107:in `temp_path'
	from /var/vcap/bosh/lib/ruby/gems/1.9.1/gems/blobstore_client-1.3232.4.0/lib/blobstore_client/base.rb:54:in `get'
	from (irb):5
	from /var/vcap/bosh/lib/ruby/gems/1.9.1/gems/blobstore_client-1.3232.4.0/bin/blobstore_client_console:67:in `'
	from /var/vcap/bosh/bin/blobstore_client_console:23:in `load'
	from /var/vcap/bosh/bin/blobstore_client_console:23:in `'

Impact/Risks 

  • Be extra careful if you modify the data ensuring that you do not delete blob objects inadvertently. 
  • This information is based on implementation details of how the Ops Manager Director is installed as well as the BOSH release, which may change at any time without formal notice.  

 

Comments

Powered by Zendesk