knife-vsphere
knife-vsphere copied to clipboard
Setting a winrm_user in knife.rb breaks linux bootstrapping in certain cases
Versions:
- Version of knife-vsphere: 2.2.1
- Version of chef: 14.7.17
Scenario:
This is a bit of an edge case but the cause/fix is likely not obvious from a user perspective.
When using the vm clone feature to bootstrap a linux box, it will attempt to SSH to the node with the win_rm user instead of the ssh_user if the following things are true:
- There is an ssh_user set in knife.rb
- There is a winrm_user set in knife.rb
- The user passes the ssh_user flag with a value matching knife.rb (e.g., both "root")
if get_config(:ssh_user).eql?(options[:ssh_user][:default]) &&
!get_config(:winrm_user).eql?(options[:winrm_user][:default])
config[:ssh_user] = get_config(:winrm_user)
end
Passing --bootstrap-protocol ssh
does not resolve this issue.