mitchellh / vagrant-google

Vagrant provider for GCE.
Apache License 2.0
334 stars 100 forks source link

Cannot Use Host Networking #231

Open dgarstang opened 4 years ago

dgarstang commented 4 years ago

I have this Vagrantfile:

  config.vm.box = "google/gce"
  config.vm.provider :google do |google, override|
    google.google_project_id = "mycorp-user-dgarstang"
    google.network_project_id = "mycorp-vpc-sandbox"
    google.subnetwork = "http://www.googleapis.com/compute/v1/projects/mycorp-vpc-sandbox/regions/us-west1/subnetworks/default-us-west1"
    google.network = "default"
    google.google_json_key_location = "/Users/dgarstang/git/puppet-integration-image/mycorp-user-dgarstang-21dbe490a8d8.json"
    google.image_family = 'puppetint'
    google.zone = "us-west1-a"
    override.ssh.username = "dgarstang"
    override.ssh.private_key_path = "~/.ssh/id_rsa"
  end
end

When I perform a 'vagrant up', I get the following:

/Users/dgarstang/.vagrant.d/gems/2.4.9/gems/google-api-client-0.23.9/lib/google/apis/core/http_command.rb:218:in `check_status': invalid: Invalid value for field 'resource.networkInterfaces[0].network': 'global/networks/default'. The referenced network resource cannot be found. (Google::Apis::ClientError)

The network 'default' definitely exists as a vpc network in the referenced host network 'mycorp-vpc-sandbox'.

Earlier, I also had a local network called 'default' in this project and was being told "Subnetwork does not belong to the network.". This is further evidence that host networking is not working - ie it was looking at the default network in my service project, not the default network in the host network.

Can we please get host networking working? This is a really important feature!

dgarstang commented 4 years ago

This is still an issue.