ggiamarchi / vagrant-openstack-provider

Use Vagrant to manage OpenStack Cloud instances.
MIT License
245 stars 102 forks source link

Existing volume not found #378

Closed dthpulse closed 5 years ago

dthpulse commented 5 years ago

I have an existing available volume on OpenStack and adding it to server during 'vagrant up' but getting error. I'm using configuration from example here.

Here is output of 'openstack volume list' | 38935e0d-e1c0-4a9c-b8f3-48a7c141419b | vagrant-osd-1 | available | 1 |

Part of Vagrantfile for attaching the volume:

     s.vm.provider :openstack do |os, override|
        os.server_name = "shiva-#{i}"
        os.volumes = [
                {
                        id: '38935e0d-e1c0-4a9c-b8f3-48a7c141419b'
                }
        ]
      end

I did try all options for defining the volume that are provided in example here.

Debug output (starting from getting volumes):

... 
2019-01-14 13:17 | DEBUG | get_all_volumes - start
2019-01-14 13:17 | DEBUG | request  => method  : GET
2019-01-14 13:17 | DEBUG | request  => url     : https://engcloud.prv.suse.net:8776/v1/a604e143bfcf4a32a4e9864f6c2a19ab/volumes/detail
2019-01-14 13:17 | DEBUG | request  => headers : {"X-Auth-Token"=>"gAAAAABcPH3M69GWTYXTUQJD54DfEUWvmmMIpI6kIPKNKIJ4zP-fH7q8zZAEx9BmUrPZRKYMDHD47SeCNZsMOFTCNWCi3igj6LCAEtoHON4yvMPtYuA8JzbrHor6qnnxQYjRzfW0o0bxGKgyJbKN1PnPIPCCBFIMlBE6Rr4uX2Ze3mtOHUEoqyrzaojdXcG9Aiq3dAX8QC2l0QIuw-NYLj3RsNrnWIntFVzEfjWxDu1bS4-kZTmR1uU", :accept=>:json}
2019-01-14 13:17 | DEBUG | response => code    : 404
2019-01-14 13:17 | DEBUG | response => headers : {:content_length=>"112", :content_type=>"application/json", :date=>"Mon, 14 Jan 2019 12:17:23 GMT", :connection=>"close"}
2019-01-14 13:17 | DEBUG | response => body    : {"message": "The resource could not be found.<br /><br />\n\n\n", "code": "404 Not Found", "title": "Not Found"}
An unknown error happened in Vagrant OpenStack provider

To easily debug what happened, we recommend to set the environment
variable VAGRANT_OPENSTACK_LOG to debug

    $ export VAGRANT_OPENSTACK_LOG=debug

If doing this does not help fixing your issue, there may be a bug
in the provider. Please submit an issue on Github at
https://github.com/ggiamarchi/vagrant-openstack-provider
with the stracktrace and the logs.

We are looking for feedback, so feel free to ask questions or
describe features you would like to see in this provider.
Traceback (most recent call last):
        48: from /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.5/lib/vagrant/batch_action.rb:82:in `block (2 levels) in run'
        47: from /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.5/lib/vagrant/machine.rb:194:in `action'
        46: from /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.5/lib/vagrant/machine.rb:194:in `call'
        45: from /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.5/lib/vagrant/environment.rb:614:in `lock'
        44: from /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.5/lib/vagrant/machine.rb:208:in `block in action'
        43: from /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.5/lib/vagrant/machine.rb:239:in `action_raw'
        42: from /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.5/lib/vagrant/action/runner.rb:66:in `run'
        41: from /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.5/lib/vagrant/util/busy.rb:19:in `busy'
        40: from /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.5/lib/vagrant/action/runner.rb:66:in `block in run'
        39: from /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.5/lib/vagrant/action/builder.rb:116:in `call'
        38: from /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:34:in `call'
        37: from /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.5/lib/vagrant/action/builtin/handle_box.rb:25:in `call'
        36: from /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:34:in `call'
        35: from /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.5/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
        34: from /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:34:in `call'
        33: from /qemu/vagrant/.vagrant.d/gems/2.5.3/gems/vagrant-openstack-provider-0.13.0/lib/vagrant-openstack-provider/action/abstract_action.rb:8:in `call'
        32: from /qemu/vagrant/.vagrant.d/gems/2.5.3/gems/vagrant-openstack-provider-0.13.0/lib/vagrant-openstack-provider/action/connect_openstack.rb:32:in `execute'
        31: from /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:34:in `call'
        30: from /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.5/lib/vagrant/action/builtin/call.rb:53:in `call'
        29: from /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.5/lib/vagrant/action/runner.rb:66:in `run'
        28: from /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.5/lib/vagrant/util/busy.rb:19:in `busy'
        27: from /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.5/lib/vagrant/action/runner.rb:66:in `block in run'
        26: from /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.5/lib/vagrant/action/builder.rb:116:in `call'
        25: from /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:34:in `call'
        24: from /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
        23: from /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:34:in `call'
        22: from /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.5/lib/vagrant/action/builtin/provision.rb:80:in `call'
        21: from /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:34:in `call'
        20: from /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.5/lib/vagrant/action/builtin/synced_folders.rb:87:in `call'
        19: from /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:34:in `call'
        18: from /qemu/vagrant/.vagrant.d/gems/2.5.3/gems/vagrant-openstack-provider-0.13.0/lib/vagrant-openstack-provider/action/abstract_action.rb:8:in `call'
        17: from /qemu/vagrant/.vagrant.d/gems/2.5.3/gems/vagrant-openstack-provider-0.13.0/lib/vagrant-openstack-provider/action/create_stack.rb:54:in `execute'
        16: from /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:34:in `call'
        15: from /qemu/vagrant/.vagrant.d/gems/2.5.3/gems/vagrant-openstack-provider-0.13.0/lib/vagrant-openstack-provider/action/abstract_action.rb:8:in `call'
        14: from /qemu/vagrant/.vagrant.d/gems/2.5.3/gems/vagrant-openstack-provider-0.13.0/lib/vagrant-openstack-provider/action/create_server.rb:38:in `execute'
        13: from /qemu/vagrant/.vagrant.d/gems/2.5.3/gems/vagrant-openstack-provider-0.13.0/lib/vagrant-openstack-provider/config_resolver.rb:114:in `resolve_volumes'
        12: from /qemu/vagrant/.vagrant.d/gems/2.5.3/gems/vagrant-openstack-provider-0.13.0/lib/vagrant-openstack-provider/client/cinder.rb:20:in `get_all_volumes'
        11: from /qemu/vagrant/.vagrant.d/gems/2.5.3/gems/vagrant-openstack-provider-0.13.0/lib/vagrant-openstack-provider/client/http_utils.rb:21:in `get'
        10: from /qemu/vagrant/.vagrant.d/gems/2.5.3/gems/vagrant-openstack-provider-0.13.0/lib/vagrant-openstack-provider/client/http_utils.rb:104:in `authenticated'
         9: from /qemu/vagrant/.vagrant.d/gems/2.5.3/gems/vagrant-openstack-provider-0.13.0/lib/vagrant-openstack-provider/client/http_utils.rb:22:in `block in get'
         8: from /qemu/vagrant/.vagrant.d/gems/2.5.3/gems/vagrant-openstack-provider-0.13.0/lib/vagrant-openstack-provider/client/rest_utils.rb:17:in `get'
         7: from /usr/lib64/ruby/gems/2.5.0/gems/rest-client-2.0.2/lib/restclient/request.rb:52:in `execute'
         6: from /usr/lib64/ruby/gems/2.5.0/gems/rest-client-2.0.2/lib/restclient/request.rb:145:in `execute'
         5: from /usr/lib64/ruby/gems/2.5.0/gems/rest-client-2.0.2/lib/restclient/request.rb:715:in `transmit'
         4: from /usr/lib64/ruby/2.5.0/net/http.rb:910:in `start'
         3: from /usr/lib64/ruby/gems/2.5.0/gems/rest-client-2.0.2/lib/restclient/request.rb:725:in `block in transmit'
         2: from /usr/lib64/ruby/gems/2.5.0/gems/rest-client-2.0.2/lib/restclient/request.rb:807:in `process_result'
         1: from /qemu/vagrant/.vagrant.d/gems/2.5.3/gems/vagrant-openstack-provider-0.13.0/lib/vagrant-openstack-provider/client/http_utils.rb:22:in `block (2 levels) in get'
/qemu/vagrant/.vagrant.d/gems/2.5.3/gems/vagrant-openstack-provider-0.13.0/lib/vagrant-openstack-provider/client/http_utils.rb:94:in `handle_response': Catched Error: Catched Error: Catched Error: undefined method `[]' for nil:NilClass (NoMethodError)
XXAmethystXX commented 5 years ago

Hi, I'm having the same problem with my volume, could you describe how you fixed this?

Thanks!