public_network -> SSH -> direct reachable = problem || provider proxmox

146 views
Skip to first unread message

Denny Fuchs

unread,
Apr 26, 2016, 8:48:05 AM4/26/16
to Vagrant
hi,

I have several Proxmox nodes running and I was able with some help and the vagrant-proxmox plugin to get KVM and LXC containers creating and starting. The problem is now, that Vagrant (1.8.1) tries to connect via ssh and the Proxmox node, instead of the ip from the container/kvm vm:

[...]
 INFO interface: Machine: action ["read_ssh_info", "end", {:target=>:box}]
DEBUG ssh: Checking key permissions: /home/foobar/.vagrant.d/insecure_private_key
 INFO ssh: Attempting SSH connection...
 INFO ssh: Attempting to connect to SSH...
 INFO ssh:   - Host: 192.168.100.5
 INFO ssh:   - Port: 229000
 INFO ssh:   - Username: vagrant
 INFO ssh:   - Password? false
 INFO ssh:   - Key Path: ["/home/foobar/.vagrant.d/insecure_private_key"]
[...]


Since I use public_network and a bridge, I expected, that Vagrant tries to connect the VM via 192.168.100.100. It works with "ssh -i ~/.vagrant.d/insecure_private_key vag...@192.168.100.100" ...

So, what I have done wrong?
  • Vagrantfile
Vagrant.configure('2') do |config|
   config.vm.provider :proxmox do |proxmox|
     proxmox.endpoint = 'https://192.168.100.5:8080/api2/json'
     proxmox.user_name = 'vagrant@pve'
     proxmox.password = 'secret'
     proxmox.vm_type = :lxc
     proxmox.openvz_os_template = 'local:vztmpl/debian-8.0-standard_8.0-4_amd64.tar.gz'
     proxmox.vm_id_range = 9000..9010
     proxmox.vm_disk_size = '1G'
     proxmox.vm_storage = 'pve-container'
     proxmox.vm_name_prefix = 'vagrant_'
     proxmox.vm_memory = 512
     proxmox.selected_node = 'pmox01'
   end

   config.vm.define :box, primary: true do |box|
     box.vm.box = 'dummy'
     box.vm.network :public_network, ip: '192.168.100.100', interface: 'eth0', bridge: 'vmbr0', gw: '192.168.100.1'
   end
end


cu denny

Alvaro Miranda Aguilera

unread,
Apr 26, 2016, 5:24:03 PM4/26/16
to vagra...@googlegroups.com

On Wed, Apr 27, 2016 at 12:48 AM, Denny Fuchs <denny....@gmail.com> wrote:
229000


hello,

the port seems quite high 229000

whats the output of vagrant ssh-config ?

Vagrant will try to connect using a NAT/FWD port from the host. However I am not sure whats the default on the proxmox plugin. Have you tried to open an issue with them? (plugin)

Other than that, have you tried with the plugin base box for test?

https://www.dropbox.com/s/vuzywdosxhjjsag/vagrant-proxmox-ubuntu-12.tar.gz


You need an OpenVZ template or KVM ISO that contains a vagrant user supplied with the default Vagrant SSH keys. You can download an example Ubuntu based template here.

Finally run vagrant up --provider=proxmox to create and start the new OpenVZ container.


Alvaro

Denny Fuchs

unread,
Apr 28, 2016, 3:49:16 AM4/28/16
to Vagrant


Am Dienstag, 26. April 2016 23:24:03 UTC+2 schrieb Alvaro Miranda Aguilera:

On Wed, Apr 27, 2016 at 12:48 AM, Denny Fuchs <denny....@gmail.com> wrote:
229000


hello,

the port seems quite high 229000

whats the output of vagrant ssh-config ?

==> box: translation missing: en.vagrant_proxmox.adjust_forwarded_port_params
Host box
  HostName 192.168.100.5
  User vagrant
  Port 229000
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile "/home/foobar/.vagrant.d/insecure_private_key"
  IdentitiesOnly yes
  LogLevel FATAL
 

You need an OpenVZ template or KVM ISO that contains a vagrant user supplied with the default Vagrant SSH keys. You can download an example Ubuntu based template here.

Finally run vagrant up --provider=proxmox to create and start the new OpenVZ container.


I have already a working template, only ssh, from Vagrant itself is the problem. The IP address should be 192.168.100.100 :-)

Reply all
Reply to author
Forward
0 new messages