{"id":14986153,"url":"https://github.com/ggiamarchi/vagrant-openstack-provider","last_synced_at":"2025-04-09T04:05:25.101Z","repository":{"id":14504821,"uuid":"17218183","full_name":"ggiamarchi/vagrant-openstack-provider","owner":"ggiamarchi","description":"Use Vagrant to manage OpenStack Cloud instances.","archived":false,"fork":false,"pushed_at":"2022-11-24T22:46:54.000Z","size":1127,"stargazers_count":248,"open_issues_count":79,"forks_count":101,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-04-02T03:07:49.515Z","etag":null,"topics":["cloud","devops","devops-tools","iaas","openstack","vagrant","vagrant-plugin","vagrant-providers","virtual-machine"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ggiamarchi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-26T17:05:30.000Z","updated_at":"2025-01-27T06:12:09.000Z","dependencies_parsed_at":"2023-01-13T17:58:54.472Z","dependency_job_id":null,"html_url":"https://github.com/ggiamarchi/vagrant-openstack-provider","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ggiamarchi%2Fvagrant-openstack-provider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ggiamarchi%2Fvagrant-openstack-provider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ggiamarchi%2Fvagrant-openstack-provider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ggiamarchi%2Fvagrant-openstack-provider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ggiamarchi","download_url":"https://codeload.github.com/ggiamarchi/vagrant-openstack-provider/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247578622,"owners_count":20961270,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud","devops","devops-tools","iaas","openstack","vagrant","vagrant-plugin","vagrant-providers","virtual-machine"],"created_at":"2024-09-24T14:12:26.280Z","updated_at":"2025-04-09T04:05:25.035Z","avatar_url":"https://github.com/ggiamarchi.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vagrant OpenStack Cloud Provider\n\n[![Build Status](https://github.com/ggiamarchi/vagrant-openstack-provider/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/ggiamarchi/vagrant-openstack-provider/actions/workflows/test.yml)\n[![Gem Version](https://badge.fury.io/rb/vagrant-openstack-provider.svg)](http://badge.fury.io/rb/vagrant-openstack-provider)\n\nThis is a [Vagrant](http://www.vagrantup.com) 1.6+ plugin that adds an\n[OpenStack Cloud](http://www.openstack.org/software/) provider to Vagrant,\nallowing Vagrant to control and provision machines within OpenStack\ncloud.\n\n**Note:** This plugin was originally forked from [mitchellh/vagrant-rackspace](https://github.com/mitchellh/vagrant-rackspace)\n\n## Features\n\n* Create and boot OpenStack instances\n* Halt and reboot instances\n* Suspend and resume instances\n* SSH into the instances\n* Automatic SSH key generation and Nova public key provisioning\n* Automatic floating IP allocation and association\n* Provision the instances with any built-in Vagrant provisioner\n* Boot instance from volume\n* Attach Cinder volumes to the instances\n* Create and delete Heat Orchestration stacks\n* Support OpenStack regions\n* Custom sub-commands within Vagrant CLI to query OpenStack objects\n\n## Usage\n\nInstall using standard Vagrant 1.1+ plugin installation methods. After\ninstalling, `vagrant up` and specify the `openstack` provider. An example is\nshown below.\n\n```console\n$ vagrant plugin install vagrant-openstack-provider\n...\n$ vagrant up\n...\n```\n\nMake sure you have a recent version of vagrant (\u003e1.7.1).\n\n## Quick Start\n\nAfter installing the plugin (instructions above), the quickest way to get\nstarted is to specify all the details manually within a `config.vm.provider`\nblock in the Vagrantfile\n\nCreate a Vagrantfile that looks like the following, filling in your information\nwhere necessary.\n\nThis Vagrantfile shows the minimal needed configuration.\n\n```ruby\nrequire 'vagrant-openstack-provider'\n\nVagrant.configure('2') do |config|\n\n  config.ssh.username = 'stack'\n\n  config.vm.provider :openstack do |os|\n    os.openstack_auth_url = 'http://keystone-server.net/v2.0/tokens'\n    os.username           = 'openstackUser'\n    os.password           = 'openstackPassword'\n    os.tenant_name        = 'myTenant'\n    os.flavor             = 'm1.small'\n    os.image              = 'ubuntu'\n    os.floating_ip_pool   = 'publicNetwork'\n  end\nend\n```\n\nAnd then run `vagrant up`.\n\n__NB.__\n\u003e See more examples in the [samples](https://github.com/ggiamarchi/vagrant-openstack-provider/tree/master/samples) directory.\n\n\n## Configuration reference\n\nThis provider exposes quite a few provider-specific configuration options:\n\n### Credentials\n\n* `username` - The username with which to access OpenStack.\n* `password` - The API key for accessing OpenStack.\n* `domain_name` - The domain name when using identity API version 3 of keystone (Overrides user and project domain)\n* `user_domain_name` - The OpenStack user domain name when using identity API version 3 of keystone\n* `tenant_name` - The OpenStack project name to work on\n* `project_name` - The OpenStack project name used in identity v3\n* `project_domain_name` - The OpenStack project domain name used in identity v3\n* `identity_api_version` - The identity version to use : 2 or 3. If not provided, vagrant will use 2 by default.\n* `region` - The OpenStack region to work on\n* `openstack_auth_url` - The endpoint to authenticate against.\n* `openstack_compute_url` - The compute service URL to hit. This is good for custom endpoints. If not provided, vagrant will try to get it from catalog endpoint.\n* `openstack_network_url` - The network service URL to hit. This is good for custom endpoints. If not provided, vagrant will try to get it from catalog endpoint.\n* `openstack_volume_url` - The block storage URL to hit. This is good for custom endpoints. If not provided, vagrant will try to get it from catalog endpoint.\n* `openstack_image_url` - The image URL to hit. This is good for custom endpoints. If not provided, vagrant will try to get it from catalog endpoint.\n* `endpoint_type` - The endpoint type to use : publicURL, adminURL, internalURL. If not provided, vagrant will use publicURL by default.\n* `interface_type` - The endpoint type to use for identity v3: public, admin, internal. If not provided, vagrant will use public by default.\n* `ssl_ca_file` - The location of CA certificate file.\n* `ssl_verify_peer` - Verify peer certificate when connecting to endpoint. Defaults to true. Set to false to disable check (beware this is not secure!)\n\n### Machine Configuration\n\n* `server_name` - The name of the server within OpenStack Cloud. This\n  defaults to the name of the Vagrant machine (via `config.vm.define`), but\n  can be overridden with this.\n* `flavor` - The name of the flavor to use for the VM\n* `image` - The name of the image to use for the VM\n* `availability_zone` - Nova Availability zone used when creating VM\n* `security_groups` - List of strings representing the security groups to apply. e.g. ['ssh', 'http']\n* `user_data` - String of User data to be sent to the newly created OpenStack instance. Use this e.g. to inject a script at boot time.\n* `metadata` - A Hash of metadata that will be sent to the instance for configuration e.g. `os.metadata  = { 'key' =\u003e 'value' }`\n* `scheduler_hints` - Pass hints to the OpenStack scheduler, e.g. { \"cell\": \"some cell name\" }\n* `server_create_timeout` - Time to wait in seconds for the server to be created when `vagrant up`. Default is `200`\n* `server_active_timeout` - Time to wait in seconds for the server to become active when `vagrant up` or `vagrant resume`. Default is `200`\n* `server_stop_timeout` - Time to wait in seconds for the server to stop when `vagrant halt`. Default is `200`\n* `server_delete_timeout` - Time to wait in seconds for the server to be deleted when `vagrant destroy`. Default is `200`\n\n#### Floating IPs\n\n* `floating_ip` - The floating IP to associate with the VM. This IP must be formerly allocated.\n* `floating_ip_pool` - The floating IP Pool or a list of floating IP pool from which a floating IP will be allocated to be associated\n   with the VM. alternative to the `floating_ip` option.\n\n`floating_ip_pool` attribute can be either a string or an array. In case of an array, if an IP can't be allocated from the first pool\nfor any reason, it will try with the second one and so on. Finally, if it does not manage to allocate a floating IP from any pools of\nthe list, it will fail.\n\n```ruby\nconfig.vm.provider :openstack do |os|\n  ...\n  os.floating_ip_pool = ['External-Network-01', 'External-Network-02']\n  ...\nend\n```\n\n* `floating_ip_pool_always_allocate` - if set to true, vagrant will always allocate floating ip instead of trying to reuse unassigned ones\n\n__N.B.__\n\u003e If the instance have a floating IP, this IP will be used to SSH into the instance.\n\n#### Networks\n\n* `networks` - Network list the server must be connected on. Can be omitted if only one private network exists\n  in the OpenStack project\n\nNetworking features in the form of `config.vm.network` are not\nsupported with `vagrant-openstack`, currently. If any of these are\nspecified, Vagrant will emit a warning, but will otherwise boot\nthe OpenStack server.\n\nYou can provide network id or name. However, in OpenStack a network name is not unique, thus if there are two networks with\nthe same name in your project the plugin will fail. If so, you have to use only ids. Optionally, you can specify the IP\naddress that will be assigned to the instance if you need a static address or if DHCP is not enable for this network.\n\nHere's an example which connect the instance to six Networks :\n\n```ruby\nconfig.vm.provider :openstack do |os|\n  ...\n  os.networks = [\n    'net-name-01',\n    '287132f0-57e6-4c31-a1ee-4823e9786ff2',\n    {\n      name: 'net-name-03',\n      address: '192.168.22.43'\n    },\n    {\n      id: '7dfdcf01-5177-4774-9473-2ae92a6447d4',\n      address: '192.168.43.76'\n    },\n    {\n      name: 'net-name-05'\n    },\n    {\n      id: '01e0950f-c668-4efe-821b-93ff6e427562'\n    }\n  ]\n  ...\nend\n```\n\n__N.B.__\n\u003e If the instance does not have a floating IP, the IP of the\n\u003e first network in the list will be used to SSH into the instance\n\n#### Volumes\n\n* `volumes` - Volume list that have to be attached to the server. You can provide volume id or name. However, in OpenStack\na volume name is not unique, thus if there are two volumes with the same name in your project the plugin will fail. If so,\nyou have to use only ids. Optionally, you can specify the device that will be assigned to the volume.\n\nHere comes an example that show six volumes attached to a server :\n\n```ruby\nconfig.vm.provider :openstack do |os|\n  ...\n  os.volumes = [\n    '619e027c-f4a9-493d-8c15-c89de81cb949',\n    'vol-name-02',\n    {\n      id: '410096ff-ef71-4ca4-8006-e5bd9e99239a',\n      device: '/dev/vdc'\n    },\n    {\n      name: 'vol-name-04',\n      device: '/dev/vde'\n    },\n    {\n      name: 'vol-name-05'\n    },\n    {\n      id: '9e419e91-8f66-4803-bc45-4600182cfd8d'\n    }\n  ]\n  ...\nend\n```\n\n* `volume_boot` - Volume to boot the VM from. When booting from an existing volume, `image` is not necessary and must not be provided.\n\n### Orchestration Stacks\n\n* `stacks` - Heat Stacks that will be automatically created when running `vagrant up`, and deleted when running `vagrant destroy`\n\nHere comes an example that show two stacks :\n\n```ruby\nconfig.vm.provider :openstack do |os|\n ...\nos.stacks = [\n  {\n    name: 'mystack1',\n    template: 'heat_template.yml'\n  }, {\n    name: 'mystack2',\n    template: '/path/to//my/heat_template.yml'\n  }]\nend\n```\n\n### SSH authentication\n\n* `keypair_name` - The name of the key pair register in nova to associate with the VM. The public key should\n  be the matching pair for the private key configured with `config.ssh.private_key_path` on Vagrant. When `config.ssh.insert_key` is `false`, this is ignored.\n* `public_key_path` - if `keypair_name` is not provided, the path to the public key will be used by vagrant to generate a keypair on the OpenStack cloud. The keypair will be destroyed when the VM is destroyed. When `config.ssh.insert_key` is `false`, this is ignored.\n\nIf neither `keypair_name` nor `public_key_path` are set, vagrant will generate a new ssh key and automatically import it in OpenStack, unless `config.ssh.insert_key` is `false`.\n\n* `ssh_disabled` - if set to `true`, all ssh actions managed by the provider will be disabled during the `vagrant up`.\n   We recommend to use this option only to create private VMs that won't be accessed directly from vagrant. By contrast,\n   others commands like `vagrant ssh` or `vagrant provision` is run normally but it is likely to fail. Default value is\n   `false`.\n\n### Synced folders\n\n**NOTE:** The settings in this section are deprecated. By default, the OpenStack provider will use standard [Vagrant Synced Folders](https://www.vagrantup.com/docs/synced-folders/basic_usage.html). Vagrant's [rsync options](https://www.vagrantup.com/docs/synced-folders/rsync.html) can be configured thusly:\n\n```ruby\nVagrant.configure(\"2\") do |config|\n  config.vm.provider :openstack do |provider, override|\n    override.vm.synced_folder '.', '/vagrant', type: 'rsync',\n      rsync__exclude: ['some/folder/to/exclude']\n  end\nend\n```\n\nUse of the settings described below will cause the OpenStack provider to fall\nback to a legacy Rsync implementation that has fewer features. A deprecation\nwarning will also be printed.\n\n\n* `sync_method` - Specify the synchronization method for shared folder between the host and the remote VM.\n  Currently, it can be \"rsync\" or \"none\". The default value is \"rsync\". If your OpenStack image does not\n  include rsync, you must set this parameter to \"none\".\n* `rsync_includes` - If `sync_method` is set to \"rsync\", this parameter give the list of local folders to sync\n  on the remote VM.\n* `rsync_ignore_files` - Is used for the rsync prameter \"--exclude-from\".  Set `rsync_ignore_files` to a list of files\n  that contain patterns to exclude from the rsync to /vagrant on a provisioned instance.  \".gitignore  or \".hgignore\" for example.\n\nThere is minimal support for synced folders. Upon `vagrant up`,\n`vagrant reload`, and `vagrant provision`, the OpenStack provider will use\n`rsync` (if available) to uni-directionally sync the folder to\nthe remote machine over SSH.\n\nThis is good enough for all built-in Vagrant provisioners (shell,\nchef, and puppet) to work!\n\n### HTTP options\n\n* `http.open_timeout` - Open timeout for any HTTP request. Default is `60`\n* `http.read_timeout` - Read timeout for any HTTP request. Default is `30`\n* `http.proxy` - HTTP Proxy URL to use for all OpenStack API calls\n\n### Provisioners meta-args\n\nWe call meta-args, dynamic arguments automatically injected by the vagrant OpenStack provider as\na provisioner argument. The notation for a meta-arg is its name surrounded by double `@` character.\n\nThe current implementation supports only shell provisioner.\n\n* `meta_args_support` - Whether meta-args injection is activated or not. Default is `false`\n\n__Available meta-args__\n\n* `@@ssh_ip@@` - The IP used by Vagrant to SSH into the machine\n\n__Usage example__\n\n```ruby\nconfig.vm.provision \"shell\", inline: 'echo \"$1 : $2\" \u003e ~/provision', args: ['IP', '@@ssh_ip@@']\n```\n\n__N.B.__\n\u003e Activate meta-args support causes Vagrant to wrap the built-in provisioning middleware into a custom\n  one provided by the OpenStack provider. As a consequence, hooks declared on the built-in provisioning\n  middleware will not be applied (see [#248](https://github.com/ggiamarchi/vagrant-openstack-provider/issues/248))\n\n\n## Vagrant standard configuration\n\nThere are some standard configuration options that this provider takes into account when\ncreating and connecting to OpenStack machines\n\n* `config.vm.box` - A box is not mandatory for this provider. However, if you are running Vagrant before version 1.6, vagrant will not start\n   if this property is not set. In this case you can assign any value to it. See section \"Box Format\" to know more about boxes.\n* `config.vm.box_url` - URL of the box when it is necessary\n* `ssh.username` - Username used by vagrant for SSH login\n* `ssh.port` - Default SSH port is 22. If set, this option will override the default for SSH login\n* `ssh.private_key_path` - If set, vagrant will use this private key path to SSH on the machine. If you set this option, the `public_key_path` option of the provider should be set.\n\n## Box Format\n\nEvery provider in Vagrant must introduce a custom box format. This\nprovider introduces `openstack` boxes. You can view an example box in\nthe [example_box/ directory](https://github.com/ggiamarchi/vagrant-openstack/tree/master/source/example_box).\nThat directory also contains instructions on how to build a box.\n\nThe box format is basically just the required `metadata.json` file\nalong with a `Vagrantfile` that does default settings for the\nprovider-specific configuration for this provider.\n\n## Custom commands\n\nCustom commands are provided for OpenStack. Type `vagrant openstack` to\nshow available commands.\n\n```console\n$ vagrant openstack\n\nUsage: vagrant openstack command\n\nAvailable subcommands:\n     image-list           List available images\n     flavor-list          List available flavors\n     network-list         List private networks in project\n     subnet-list          List subnets for available networks\n     floatingip-list      List floating IP and floating IP pools\n     volume-list          List existing volumes\n     reset                Reset Vagrant OpenStack provider to a clear state\n```\n\nFor instance `vagrant openstack image-list` lists images available in Glance.\n\n```console\n$ vagrant openstack image-list\n\n+--------------------------------------+---------------------+\n| ID                                   | Name                |\n+--------------------------------------+---------------------+\n| 594f1287-9de3-4f3e-b82a-6ad223943ab2 | ubuntu-12.04_x86_64 |\n| 3e5aca4a-bf12-4721-87df-7bc8fd1fc36c | debian7_x86_64      |\n| 3e561121-d8d0-4328-b319-7076bfb3b18a | ubuntu-14.04_x86_64 |\n| 5c576643-7ea3-49db-b1c0-9b245d955ee0 | rhel65_x86_64       |\n| d3145dd5-654a-4936-b421-9333f02ae66c | centos6_x86_64      |\n+--------------------------------------+---------------------+\n```\n\n## Contribute\n\n### Development\n\nTo work on the `vagrant-openstack` plugin, clone this repository out, and use\n[Bundler](http://gembundler.com) to get the dependencies.\n\nThis is actually done automatically using the Vagrantfile at the root of this\nrepository to setup a Virtualbox machine embbeding a Devstack installation and a Ruby\ndevelopment environment.\n\nFrom this VM, basically run vagrant as usual to test your local source code changes.\nIt is going to run into a bundler context to use sources mounted in `/vagrant`.\n\nA basic Vagrantfile is present in `dev/test` in order to ensure your dev environement is\noperating as expected.\n\nAlso, run the following command to launch code style checks and unit tests.\n\n```console\n$ bundle exec rake\n```\n\n## Troubleshooting\n\n### Logging\n\nTo enable all Vagrant logs set environment variable `VAGRANT_LOG` to the desire\nlog level (for instance `VAGRANT_LOG=debug`). If you want only OpenStack provider\nlogs use the variable `VAGRANT_OPENSTACK_LOG`. if both variables are set, `VAGRANT_LOG`\ntakes precedence.\n\n### Version checker\n\nEach time Vagrant OpenStack Provider runs it checks the installed plugin version and\nprint a warning on stderr if the plugin is not up-to-date.\n\nIf for any reason you need to disable this check, set the environment variable\n`VAGRANT_OPENSTACK_VERSION_CKECK` to value `DISABLED` prior to run vagrant.\n\n### CentOS/RHEL/Fedora (sudo: sorry, you must have a tty to run sudo)\n\nThe default configuration of the RHEL family of Linux distributions requires a\ntty in order to run sudo. Vagrant does not connect with a tty by default, so\nyou may experience the error:\n\u003e sudo: sorry, you must have a tty to run sudo\n\nThe best way to take deal with this error is to upgrade to Vagrant 1.4 or\nlater, and enable:\n```ruby\nconfig.ssh.pty = true\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fggiamarchi%2Fvagrant-openstack-provider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fggiamarchi%2Fvagrant-openstack-provider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fggiamarchi%2Fvagrant-openstack-provider/lists"}