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

Cannot spin up using only internal IP #267

Open
nekodojo opened this issue Aug 18, 2022 · 1 comment
Open

Cannot spin up using only internal IP #267

nekodojo opened this issue Aug 18, 2022 · 1 comment

Comments

@nekodojo
Copy link

I'm trying to spin up an instance using only internal IP (no external allowed). I get the message

Specified external IP address is invalid or does not exist.
IP address requested: false

Yes, I did configure external IP to be disabled. From my laptop, we already have VPN set up to be able to access the private ranges directly. But, it looks like it is not even getting to the spin up stage, only the info block followed by this message.

I have retried with both google.use_private_ip = "true" and google.use_private_ip = "false" - in both cases I am keeping google.external_ip = "false". Both cases give the same error.

Full config with some of my details removed

Vagrant.configure("2") do |config|
  config.vm.box = "google/gce"

  ## this provider details are on https://github.com/mitchellh/vagrant-google 
  config.vm.provider :google do |google, override|
    google.google_project_id  = "xxxproject"
    # google.image_project_id   = 'debian-cloud'
    # google.image_family       = 'debian-11'
    google.image_project_id   = 'ubuntu-os-cloud'
    google.image_family       = 'ubuntu-2004-lts'
    google.machine_type       = "e2-standard-2"
    google.disk_type          = "pd-standard"
    google.network            = "xxxnetwork"
    google.subnetwork         = "xxxsubnetwork"
    google.external_ip        = "false"  # This didn't work for me
    google.use_private_ip     = "true"  # tried both true and false
    google.auto_restart       = "false"
    google.zone               = "us-central1-f"
    
    override.ssh.username = "myuser"
    override.ssh.private_key_path = "~/.ssh/id_rsa"
  end

    config.vm.box_check_update = false
    
    # # Sample shell startup for all node types
    # config.vm.provision :shell, :path => "linux/ubuntu/20.04/prerequisites.sh"
    
    # Plan automatic shutdown of machine to prevent unwanted costs
    config.vm.provision "auto-shutdown", type: "shell", run: "always",
      inline: "shutdown -P +120" # = 60 minutes * 2 hours
    
    config.vm.define "gconnor-jump-stage" do |mybox|
        mybox.vm.hostname = "gconnor-jump-stage"
        
        # # Sample shell startup for specific node type
        # config.vm.provision :shell, :path => "linux/ubuntu/20.04/prerequisites.sh"
        
        # # Sample ansible start provisioning
        # mybox.vm.provision "ansible" do |ansible|
        #   ansible.playbook = "kubernetes-setup/master-playbook.yml"
        #   #ansible.verbose = "v"
        #   ansible.extra_vars = {
        #       node_ip: "192.168.50.10",
        #   }
        # end
    end

end

My versions
vagrant --version
Vagrant 2.2.14
vagrant plugin install vagrant-google:
Installed the plugin 'vagrant-google (2.7.0)'!
Laptop: MacOS 10.15

@azmng
Copy link

azmng commented Aug 19, 2022

I guess you should get rid of quotes, below example works for me:

google.external_ip = false
google.use_private_ip = true

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