# Using Vagrant With Platform9 Managed OpenStack

Developers and end users can use Vagrant to deploy virtual machines on Platform9 Managed OpenStack. This tutorial describes the steps to do so.

We use following GitHub Vagrant OpenStack plugin for this tutorial:

<https://github.com/ggiamarchi/vagrant-openstack-provider>

### Step 1 - Download and Install Vagrant Plugin for OpenStack

Download and install the vagrant plugin for OpenStack on your machine.

{% tabs %}
{% tab title="Shell" %}

```bash
vagrant plugin install vagrant-openstack-provider
```

{% endtab %}
{% endtabs %}

### Step 2 - Create a Dummy Vagrant Box for OpenStack

Vagrant has a concept of 'boxes' which are package format for Vagrant environments. For the purpose of connecting to a remote OpenStack endpoint, we need to create a dummy Vagrant box.

{% tabs %}
{% tab title="Shell" %}

```bash
vagrant box add dummy https://github.com/cloudbau/vagrant-openstack-plugin/raw/master/dummy.box
```

{% endtab %}
{% endtabs %}

### Step 3 - Configure Your Vagrantfile

Create a new directory and copy the Vagrantfile that is provided with this tutorial into the directory.

Customize the Vagrantfile to fill in parameters specific to your Platform9 Managed OpenStack account, and other details. The sample Vagrantfile provided here offers plenty of comments to help.

### Step 4 - Deploy the VM

{% tabs %}
{% tab title="Shell" %}

```bash
vagrant up --provider=openstack
```

{% endtab %}
{% endtabs %}

This will start a VM in your Platform9 environment and SSH into it directly.

Congratulations! Your Vagrant box was just deployed! Vagrant and Platform9 did the necessary work of deploying the VM onto your underlying infrastructure.

You can also use:

* `vagrant destroy` to kill the VM
* `vagrant ssh` to SSH into an already created VM.

{% hint style="info" %}
**Note**

Vagrant does not like if you delete a VM behind Vagrant’s back. To reset Vagrant’s state in such situations, execute `vagrant openstack reset`.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.platform9.com/managed-openstack/5.8/cli-access/cli-access-cli-vagrant.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
