chef-provisioning-vsphere icon indicating copy to clipboard operation
chef-provisioning-vsphere copied to clipboard

Possiblity of having Chef Node Name different from Hostname

Open skarungan opened this issue 7 years ago • 6 comments

machine "testubuntu03" do
end

This create nodename as testubuntu03 in chef. Is it possible to specify chef's node name while provisioning a machine (different from hostname).

skarungan avatar May 05 '17 00:05 skarungan

Did this happen on windows ?

juanxhos avatar May 11 '17 12:05 juanxhos

This is already available through use of the 'vsphere_name' property.

johnsoja40 avatar May 16 '17 17:05 johnsoja40

Should we make this more clear in the README? I'd love a PR with suggestions.

jjasghar avatar May 16 '17 17:05 jjasghar

yes, this is for a windows machine. we want chef to name the machine with fqdn. for example: machine "testmachine01" do end
vs machine "testmachine01.local" do end

rperez31 avatar Jul 11 '17 02:07 rperez31

@johnsoja40 I don't think that property exists. I could only find references to it in the kitchen driver. All the code seems to use machine_spec.name when creating and referencing the VM.

petracvv avatar Jun 21 '18 20:06 petracvv

don't think you can without modifying some code... I believe it is here that preps the chef entry for saving. https://github.com/chef/chef-provisioning/blob/master/lib/chef/provider/machine.rb line 188

  @machine_spec = chef_managed_entry_store.new_entry(:machine, new_resource.name, json)

The new_resource.name is a property inherited all the way from https://github.com/chef/chef/blob/master/lib/chef/resource.rb which is what you get when you pass

   machine "machine_name" do
       something
   end

Just a guess after looking...

hrmmmwhynot avatar Jul 12 '18 07:07 hrmmmwhynot