{"action":"created","issue":{"url":"https://api.github.com/repos/josenk/vagrant-vmware-esxi/issues/15","repository_url":"https://api.github.com/repos/josenk/vagrant-vmware-esxi","labels_url":"https://api.github.com/repos/josenk/vagrant-vmware-esxi/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/josenk/vagrant-vmware-esxi/issues/15/comments","events_url":"https://api.github.com/repos/josenk/vagrant-vmware-esxi/issues/15/events","html_url":"https://github.com/josenk/vagrant-vmware-esxi/issues/15","id":293787372,"number":15,"title":"ssh-config HostName/IP changes post running a provisioning script","user":{"login":"skorada-rvbd","id":33629203,"avatar_url":"https://avatars2.githubusercontent.com/u/33629203?v=4","gravatar_id":"","url":"https://api.github.com/users/skorada-rvbd","html_url":"https://github.com/skorada-rvbd","followers_url":"https://api.github.com/users/skorada-rvbd/followers","following_url":"https://api.github.com/users/skorada-rvbd/following{/other_user}","gists_url":"https://api.github.com/users/skorada-rvbd/gists{/gist_id}","starred_url":"https://api.github.com/users/skorada-rvbd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skorada-rvbd/subscriptions","organizations_url":"https://api.github.com/users/skorada-rvbd/orgs","repos_url":"https://api.github.com/users/skorada-rvbd/repos","events_url":"https://api.github.com/users/skorada-rvbd/events{/privacy}","received_events_url":"https://api.github.com/users/skorada-rvbd/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-02T06:34:23Z","updated_at":"2018-02-09T07:03:10Z","closed_at":"2018-02-09T07:03:10Z","author_association":"NONE","body":"Hi Jonathan,\r\n\r\nNeed some info on this issue that I have been facing. I am not entirely sure if its a plugin issue but I dont see it happening when I run the same tests on libvirt.\r\n\r\nVagrantfile:\r\n\r\n```\r\nVAGRANTFILE_API_VERSION = \"2\"\r\nVagrant.configure(VAGRANTFILE_API_VERSION) do |config|\r\n  config.ssh.forward_agent = true\r\n  config.vm.define test-vm do |x|\r\n    x.vm.box = \"bento/ubuntu-16.04\"\r\n    x.vm.provider :vmware_esxi do |v|\r\n      v.esxi_hostname = '10.xx.xx.19'\r\n      v.esxi_username = 'root'\r\n      v.esxi_password = 'secret'\r\n      v.custom_vmx_settings = [['vhv.enable', 'TRUE']]\r\n      v.vmname = test-vm\r\n      v.memsize = 6000\r\n      v.numvcpus = 2\r\n      v.debug = 'true'\r\n      v.allow_overwrite = 'True'\r\n    end\r\n  end\r\nend\r\n```\r\n\r\nPrior to the script that runs, following is the out of vagrant ssh-config\r\n\r\n```\r\n==> test-vm: --- ESXi version    : VMware ESXi 6.5.0 build-4887370\r\nHost test-vm\r\nHostName 10.xx.xx.xx   ====> The hostname \r\nUser vagrant\r\nPort 22\r\nUserKnownHostsFile /dev/null\r\nStrictHostKeyChecking no\r\nPasswordAuthentication no\r\nIdentityFile /home/username/.vagrant.d/insecure_private_key\r\nIdentitiesOnly yes\r\nLogLevel FATAL\r\nForwardAgent yes\r\nWith this when I run vagrant ssh it does a ssh to the VM without being prompted for a password\r\n```\r\n\r\nI can directly access the vm running `vagrant ssh`\r\n\r\n```\r\n==> test-vm: --- ESXi version    : VMware ESXi 6.5.0 build-4887370\r\nWelcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-87-generic x86_64)\r\n\r\n* Documentation:  https://help.ubuntu.com\r\n* Management:     https://landscape.canonical.com\r\n* Support:        https://ubuntu.com/advantage\r\n\r\n0 packages can be updated.\r\n0 updates are security updates.\r\n\r\nvagrant@vagrant:~$   ===> PASSWORDLESS SSH\r\n```\r\n\r\nNow I modify the vagrant file to include a shell script that provisions my VM after it comes up.\r\nThe script does a couple of stuff, like creates some bridge network interfaces and installs some packages etc.\r\n\r\nI modify my Vagrant file to include the following\r\n\r\n```\r\nx.vm.provision :shell do |s|\r\n       s.path = /home/username/test.sh\r\n    end\r\n```\r\n\r\nPost the script, vagrant ssh-config.\r\n\r\n```\r\nHost test-vm\r\nHostName 172.18.0.1 ===> CHANGED\r\nUser vagrant\r\nPort 22\r\nUserKnownHostsFile /dev/null\r\nStrictHostKeyChecking no\r\nPasswordAuthentication no\r\nIdentityFile /home/username/.vagrant.d/insecure_private_key\r\nIdentitiesOnly yes\r\nLogLevel FATAL\r\nForwardAgent yes\r\nWhy does vagrant change the hostname. Due to this I am unable to do a passwordless ssh to the VM using 'vagrant ssh'\r\n```\r\n\r\nNow when I try to run a vagrant ssh, it asks for a password.\r\n\r\n```\r\nvagrant ssh\r\nvagrant@172.18.0.1's password:  ====> PASSWORD PROMPT\r\n```\r\n\r\nI have tried the same test with libvirt and I dont run into this.\r\nWhy does the IP in the ssh-config change?\r\n\r\nRegards"},"comment":{"url":"https://api.github.com/repos/josenk/vagrant-vmware-esxi/issues/comments/364352746","html_url":"https://github.com/josenk/vagrant-vmware-esxi/issues/15#issuecomment-364352746","issue_url":"https://api.github.com/repos/josenk/vagrant-vmware-esxi/issues/15","id":364352746,"user":{"login":"skorada-rvbd","id":33629203,"avatar_url":"https://avatars2.githubusercontent.com/u/33629203?v=4","gravatar_id":"","url":"https://api.github.com/users/skorada-rvbd","html_url":"https://github.com/skorada-rvbd","followers_url":"https://api.github.com/users/skorada-rvbd/followers","following_url":"https://api.github.com/users/skorada-rvbd/following{/other_user}","gists_url":"https://api.github.com/users/skorada-rvbd/gists{/gist_id}","starred_url":"https://api.github.com/users/skorada-rvbd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skorada-rvbd/subscriptions","organizations_url":"https://api.github.com/users/skorada-rvbd/orgs","repos_url":"https://api.github.com/users/skorada-rvbd/repos","events_url":"https://api.github.com/users/skorada-rvbd/events{/privacy}","received_events_url":"https://api.github.com/users/skorada-rvbd/received_events","type":"User","site_admin":false},"created_at":"2018-02-09T07:03:10Z","updated_at":"2018-02-09T07:03:10Z","author_association":"NONE","body":"I couldnt figure why this was happening. Maybe something my script is doing that causing the change. Closing the issue. Thanks Jonathan"}}
{"actor":{"display_login":"skorada-rvbd"}}