MissionCriticalCloud/vagrant-cloudstack

network_ids should be ignored when network_type is set to Basic

nicolasbrechet opened this issue · 3 comments

Hi,

If you use a Vagrantfile specifying network_type='Basic' and network_id="xxxx_xxxx", running vagrant up fails with can't specify network ids in basic zone.

Fails with can't specify network ids in basic zone:

Vagrant.configure("2") do |config|
  config.vm.provider :cloudstack do |cloudstack, override|
    cloudstack.host = "api.exoscale.ch"
    cloudstack.path = "/compute"
    cloudstack.port = "443"
    cloudstack.scheme = "https"
    cloudstack.template_id = "cdefccdb-996d-41c4-9ffc-7e493ba24957"
    cloudstack.network_id = "00304a04-c7ea-4e77-a786-18bc64347bf7"
    cloudstack.zone_id = "1128bd56-b4d9-4ac6-a7b9-c715b187ce11"
    cloudstack.network_type = "Basic"
  end
end

Works:

Vagrant.configure("2") do |config|
  config.vm.provider :cloudstack do |cloudstack, override|
    cloudstack.host = "api.exoscale.ch"
    cloudstack.path = "/compute"
    cloudstack.port = "443"
    cloudstack.scheme = "https"
    cloudstack.template_id = "cdefccdb-996d-41c4-9ffc-7e493ba24957"
    #cloudstack.network_id = "00304a04-c7ea-4e77-a786-18bc64347bf7"
    cloudstack.zone_id = "1128bd56-b4d9-4ac6-a7b9-c715b187ce11"
    cloudstack.network_type = "Basic"
  end
end

Shouldn't it warn the user that network_id will not be used, instead of failing ? This would allow users to keep using Vagrantfile that were working with previous versions of vagrant-cloudstack.

(Behavior apparently changed with #82 )

Out of curiousity, if network_id is not supported with 'Basic', why/when would you have that entry if you also specify cloudstack.network_type = "Basic"?

Well as far I as understand there's no reason to specify the network_id.
The main problem here is that boxes or Vagrantfiles created before #82 are no longer working...

Fixed by PR #134

@nicolasbrechet, if the PR didn't fix the issue, let me know. Closing for now. We can re-open if there's still an issue.