Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't Launch Vagrant VM on a Shared Subnet #221

Open
dgarstang opened this issue Jul 25, 2019 · 1 comment
Open

Can't Launch Vagrant VM on a Shared Subnet #221

dgarstang opened this issue Jul 25, 2019 · 1 comment

Comments

@dgarstang
Copy link

dgarstang commented Jul 25, 2019

I have this Vagrantfile

Vagrant.configure("2") do |config|
  config.vm.box = "google/gce"
  config.vm.provider :google do |google, override|
    google.google_project_id = "corp-user-dgarstang"
    google.google_json_key_location = "~/Downloads/corp-user-dgarstang.json"
    google.image_family = "centos-7"
    google.subnetwork = "default-us-west1"
    #google.subnetwork = "https://www.googleapis.com/compute/v1/projects/corp-vpc-sandbox/regions/us-west1/subnetworks/default-us-west1"
    #google.network = "default"
    google.zone = "us-west1-a"
    google.network_project_id = "corp-vpc-sandbox"
    google.tags = ["egress-web"]
    #google.image_project_id = "corp-user-dgarstang"
    override.ssh.username = "dgarstang"
    override.ssh.private_key_path = "~/.ssh/id_rsa"
  end
end

and vagrant responds with:

/Users/dgarstang/.vagrant.d/gems/2.4.4/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].subnetwork': 'default-us-west1'. The URL is malformed. (Google::Apis::ClientError)

It doesn't even make it to the API. If I set google.subnetwork to 'default-us-west1' then the Google API responds with:

/Users/dgarstang/.vagrant.d/gems/2.4.4/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)

I'm trying to put the vagrant vm on a subnet shared from the corp-vpc-sandbox project. The same configuration works with other tools like Terraform and packer. There's no examples I can find of doing this.

Vagrant google plugin version is 2.4.0.

Doug

@Temikus
Copy link
Collaborator

Temikus commented Jul 26, 2019

Thanks for reporting this!

Can you give me a small hint on how to reproduce this? I want to make sure that my setup is close to what you're doing. Just giving a general idea of how networks are shared between projects should be enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants