<commit_before>---
title: Validate your OpenStack Instance
---

This topic helps you validate your target OpenStack in preparation for installing BOSH and deploying Cloud Foundry.

You will need a running OpenStack environment. Note that only [Folsom](https://wiki.openstack.org/wiki/ReleaseNotes/Folsom), [Grizzly](https://wiki.openstack.org/wiki/ReleaseNotes/Grizzly) and [Havana](https://wiki.openstack.org/wiki/ReleaseNotes/Havana) OpenStack releases are supported.

The requirements listed here are considered necessary but not sufficient for BOSH to be able to use your OpenStack deployment. If you cannot perform any one of these tasks successfully, BOSH will not work; however, satisfying all these requirements does not ensure that BOSH will work.

See [Troubleshooting Cloud Foundry on OpenStack](./troubleshooting.html) for
additional troubleshooting information.

## <a id="api_access"></a>Can you access the OpenStack APIs for your instance of OpenStack? ##

You should verify that you have your OpenStack API credentials and can make API calls. Credentials are a combination of your user name, password, and the tenant or project your cloud is running under. Some providers also require you to set the region.

Create a `~/.fog` file and copy the below content:

<pre class="yaml">
:openstack:
  :openstack_auth_url:  http://HOST_IP:5000/v2.0/tokens
  :openstack_api_key:   PASSWORD
  :openstack_username:  USERNAME
  :openstack_tenant:    PROJECT_NAME
  :openstack_region:    REGION # Optional
</pre>

<p class="note"><strong>Note</strong>: You need to include `/v2.0/tokens` in the auth URL above.</p>

Install the `fog` application in your terminal, then run it in interactive mode:

<pre class="terminal">
$ gem install fog
$ fog openstack
>> Compute[:openstack].servers
[]
</pre>

The `[]` is an empty array in Ruby. You might see a long list of servers being displayed if your OpenStack tenancy/project already contains provisioned servers.

<p class="note"><strong>Note</strong>: It is recommended that you deploy BOSH and Cloud Foundry in a dedicated tenancy. This way, it is easier to keep track of the servers, volumes, security groups, and networks that you create. It also allows you to manage user access.</p>

For more information on OpenStack APIs, see the [OpenStack API Quick Start Guide](http://docs.openstack.org/api/quick-start/content/).


## <a id="metadata_service"></a> Can you access OpenStack metadata service from a virtual machine? ##

According to [the OpenStack Documentation](http://docs.openstack.org/grizzly/openstack-compute/admin/content/metadata-service.html), the Compute service uses a special metadata service to enable virtual machine instances to retrieve instance-specific data. The default stemcell for use with BOSH retrieves this metadata for each instance of a virtual machine that OpenStack manages in order to get some data injected by the BOSH director.

You must ensure that virtual machines you boot in your OpenStack environment can access the metadata service at http://169.254.169.254.

From your OpenStack dashboard, create a VM and open the console into it through the **Console** tab on its **Instance Detail** page. Wait for the terminal to appear and login.

Then execute the curl command to access the above URL. You should see a list of dates similar to the example below.

<pre class="terminal">
$ curl http://169.254.169.254

1.0
2007-01-19
2007-03-01
2007-08-29
2007-10-10
2007-12-15
2008-02-01
2008-09-01
2009-04-04

</pre>

If you do not see a list like this, consult the OpenStack documentation, or the documentation for your OpenStack distribution, to diagnose and resolve networking issues.

If the metadata service is not enabled in your OpenStack instance, you can also try [inserting instance specific data](http://docs.openstack.org/grizzly/openstack-compute/admin/content/instance-data.html#inserting_metadata) such as injecting a file when booting a VM:

<pre class="terminal">
$ gem install fog
$ fog openstack
>> s = Compute[:openstack].servers.create(name: 'test', flavor_ref: , image_ref: , personality: [{'path' => 'user_data.json', 'contents' => 'test' }])
SyntaxError: (irb):5: syntax error, unexpected ','
...ate(name: 'test', flavor_ref: , image_ref: , personality: [{...
...                               ^
(irb):5: syntax error, unexpected ')', expecting $end
  from /Users/pivotal/.gem/ruby/1.9.3/gems/fog-1.18.0/bin/fog:76:in `block in <\top (required)>'
  from /Users/pivotal/.gem/ruby/1.9.3/gems/fog-1.18.0/bin/fog:76:in `catch'
  from /Users/pivotal/.gem/ruby/1.9.3/gems/fog-1.18.0/bin/fog:76:in `<\top (required)>'
  from /Users/pivotal/.gem/ruby/1.9.3/bin/fog:23:in `load'
  from /Users/pivotal/.gem/ruby/1.9.3/bin/fog:23:in `<\main>'
</pre>

## <a id="private_ping"></a> Can you ping one virtual machine from another? ##

Cloud Foundry requires that virtual machines be able to communicate with each other over the OpenStack networking stack. If networking is misconfigured for your instance of OpenStack, BOSH may provision VMs, but the deployment of Cloud Foundry will not function correctly because the VMs cannot properly orchestrate over NATS and other underlying technologies.
<commit_msg>edits to validate_openstack<commit_after>---
title: Validate your OpenStack Instance
---

This topic helps you validate your target OpenStack in preparation for installing BOSH and deploying Cloud Foundry.

You will need a running OpenStack environment. Note that only [Folsom](https://wiki.openstack.org/wiki/ReleaseNotes/Folsom), [Grizzly](https://wiki.openstack.org/wiki/ReleaseNotes/Grizzly) and [Havana](https://wiki.openstack.org/wiki/ReleaseNotes/Havana) OpenStack releases are supported.

The requirements listed here are considered necessary but not sufficient for BOSH to be able to use your OpenStack deployment. If you cannot perform any one of these tasks successfully, BOSH will not work; however, satisfying all these requirements does not ensure that BOSH will work.

See [Troubleshooting Cloud Foundry on OpenStack](./troubleshooting.html) for
additional troubleshooting information.

## <a id="api_access"></a>Can you access the OpenStack APIs for your instance of OpenStack? ##

You should verify that you have your OpenStack API credentials and can make API calls. Credentials are a combination of your user name, password, and the tenant or project your cloud is running under. Some providers also require you to set the region.

Create a `~/.fog` file and copy the below content:

<pre class="yaml">
:openstack:
  :openstack_auth_url:  http://HOST_IP:5000/v2.0/tokens
  :openstack_api_key:   PASSWORD
  :openstack_username:  USERNAME
  :openstack_tenant:    PROJECT_NAME
  :openstack_region:    REGION # Optional
</pre>

<p class="note"><strong>Note</strong>: You need to include `/v2.0/tokens` in the auth URL above.</p>

Install the `fog` application in your terminal, then run it in interactive mode:

<pre class="terminal">
$ gem install fog
$ fog openstack
>> Compute[:openstack].servers
[]
</pre>

The `[]` is an empty array in Ruby. You might see a long list of servers being displayed if your OpenStack tenancy/project already contains provisioned servers.

<p class="note"><strong>Note</strong>: It is recommended that you deploy BOSH and Cloud Foundry in a dedicated tenancy. This way, it is easier to keep track of the servers, volumes, security groups, and networks that you create. It also allows you to manage user access.</p>

For more information on OpenStack APIs, see the [OpenStack API Quick Start Guide](http://docs.openstack.org/api/quick-start/content/).


## <a id="metadata_service"></a> Can you access OpenStack metadata service from a virtual machine? ##

According to [the OpenStack Documentation](http://docs.openstack.org/grizzly/openstack-compute/admin/content/metadata-service.html), the Compute service uses a special metadata service to enable virtual machine instances to retrieve instance-specific data. The default stemcell for use with BOSH retrieves this metadata for each instance of a virtual machine that OpenStack manages in order to get some data injected by the BOSH director.

You must ensure that virtual machines you boot in your OpenStack environment can access the metadata service at http://169.254.169.254.

From your OpenStack dashboard, create a VM and open the console into it through the **Console** tab on its **Instance Detail** page. Wait for the terminal to appear and login.

Then execute the curl command to access the above URL. You should see a list of dates similar to the example below.

<pre class="terminal">
$ curl http://169.254.169.254

1.0
2007-01-19
2007-03-01
2007-08-29
2007-10-10
2007-12-15
2008-02-01
2008-09-01
2009-04-04

</pre>

If you do not see a list like this, consult the OpenStack documentation, or the documentation for your OpenStack distribution, to diagnose and resolve networking issues.

If the metadata service is not enabled in your OpenStack instance, you can also try [inserting instance specific data](http://docs.openstack.org/grizzly/openstack-compute/admin/content/instance-data.html#inserting_metadata) such as injecting a file when booting a VM:

<pre class="terminal">
$ gem install fog
$ fog openstack
>> s = Compute[:openstack].servers.create(name: 'test', flavor_ref: , image_ref: , personality: [{'path' => 'user_data.json', 'contents' => 'test' }])
SyntaxError: (irb):5: syntax error, unexpected ','
...ate(name: 'test', flavor_ref: , image_ref: , personality: [{...
...                               ^
(irb):5: syntax error, unexpected ')', expecting $end
  from /Users/pivotal/.gem/ruby/1.9.3/gems/fog-1.18.0/bin/fog:76:in `block in %lt;top (required)>'
  from /Users/pivotal/.gem/ruby/1.9.3/gems/fog-1.18.0/bin/fog:76:in `catch'
  from /Users/pivotal/.gem/ruby/1.9.3/gems/fog-1.18.0/bin/fog:76:in `\<top (required)>'
  from /Users/pivotal/.gem/ruby/1.9.3/bin/fog:23:in `load'
  from /Users/pivotal/.gem/ruby/1.9.3/bin/fog:23:in `\<main>'
</pre>

## <a id="private_ping"></a> Can you ping one virtual machine from another? ##

Cloud Foundry requires that virtual machines be able to communicate with each other over the OpenStack networking stack. If networking is misconfigured for your instance of OpenStack, BOSH may provision VMs, but the deployment of Cloud Foundry will not function correctly because the VMs cannot properly orchestrate over NATS and other underlying technologies.

{'fraction_non_alphanumeric': 0.09863749760122817, 'fraction_numerical': 0.02629053924390712, 'mean_word_length': 4.4857894736842105, 'pattern_counts': {'":': 0, '<': 52, '<?xml version=': 0, '>': 65, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5378633', 'n_tokens_mistral': 3180, 'n_tokens_neox': 2979, 'n_words': 1228}