VMware Cloud Community
VMANALYST
Enthusiast
Enthusiast

Setting the Property of HostName and VirtualMachine.NetworkN.DNSSuffix not setting the FQDN on vcenter Machine

Hi,

We are setting the Hostname and  VirtualMachine.Network0.DNSSuffix  from a VCO workflow by extending the WFStubBuildingMachine. The hostname is set but the DNSSuffix is not getting appended to become a FQDN on vcenter vm.

Are we missing any step in process of setting a FQDN for a virtual machine programitcally using VCO.

We do not want to use VCAC Network profiles as we integrating with an external IPAM solution which provides us a Hostname and its DNSSuffix

Regards

Pankaj

Reply
0 Kudos
19 Replies
chrisheartland
Enthusiast
Enthusiast

I may be misunderstanding, but you will probably have to provide us the code you are using to concatenate and apply the host name so we can see exactly what is happening.

Reply
0 Kudos
VMANALYST
Enthusiast
Enthusiast

We are setting following properties from vco workflow during WFStubBuildingMachine using the action provided in vcac plugin "addupdatepropertyFromVirtualMachineEntity". All the other properties are getting reflected on vcenter VM.

[2014-08-27 23:08:23.364] [I] Create property Hostname :testvalue on virtualMachine entity testvalue

[2014-08-27 23:08:24.772] [I] Create property VirtualMachine.Network0.Address : 100.390.150.10 on virtualMachine entity testvalue

[2014-08-27 23:08:25.836] [I] Create property VirtualMachine.Network0.Gateway : 100.390.150.1 on virtualMachine entity testvalue

[2014-08-27 23:08:27.649] [I] Create property VirtualMachine.Network0.PrimaryDns : 100.390.150.154 on virtualMachine entity testvalue

[2014-08-27 23:08:28.567] [I] Create property VirtualMachine.Network0.SubnetMask : 255.255.255.0 on virtualMachine entity testvalue

[2014-08-27 23:08:29.405] [I] Create property VirtualMachine.Network0.DnsSuffix : test.company.com on virtualMachine entity testvalue

We also tried setting the values for

"VirtualMachineName":testvalue

"VMDNSName":test.company.com

Hope this clarifies.

Regards

Pankaj

Reply
0 Kudos
chrisheartland
Enthusiast
Enthusiast

Here is what I have for my code to rename our VM.

var virtualMachineProps =

{

  VirtualMachineName : finalName,

  VMDNSName : finalName

};

Make sure whatever you're using for "finalName" as I have above has the values already concatenated. The VirtualMachineName and VMNDSName properties must be the same value. Also make sure you're sending this to "update a vcac model entity" for the name.

On a side note, are you using the actual owrkflow called "create / update property on vm entity" or are you just using the action

"actionResult = System.getModule("com.vmware.library.vcac").addUpdatePropertyFromVirtualMachineEntity(host,virtualMachineEntity,propertyName,propertyValue,propertyIsHidden,propertyIsRuntime,propertyIsEncrypted,doNotUpdate) ;" in a scriptable task? I ask because I can't get either of these to work when I'm trying to update my properties during the building phase.

If you're getting these to work would yo mind sharing the portion of code you have set for this?

Reply
0 Kudos
VMANALYST
Enthusiast
Enthusiast

I am using the workflow "create / update property on vm entity" to update

var virtualMachineProps =

{

  VirtualMachineName : finalName,

  VMDNSName : finalName

};

I tried both

  1. finalName = testvalue
  2. finalName=testvalue.test.company.com

But same result , it simply removes the "." and set the DNS/Hostname  as "testvalue" and "testvaluetestcompanycom" respectively.

To set other properties I am using the action "addupdatepropertyFromVirtualMachineEntity" in the Workflow multiple times. Attached is the workflow for your reference.

Regards

Pankaj

Reply
0 Kudos
VMANALYST
Enthusiast
Enthusiast

Can you please share what settings you have used in Config Spec in vcenter. I am getting the same issue if we are using the DNSSuffix from Network profile of vcac , it is not creating FQDN on vcenter vm.

Regards

Pankaj

Reply
0 Kudos
chrisheartland
Enthusiast
Enthusiast

The vCenter customization spec should be set to "Use the virtual machine name" under "Computer Name" setting.

Reply
0 Kudos
VMANALYST
Enthusiast
Enthusiast

I have the same settings.. Any idea why it is not working with Network Profile also, I am trying to put all the setting in Network profile and using a simple blueprint to provision a machine not extensibility then also it is not setting the FQDN.

Regards

Pankaj

Reply
0 Kudos
chrisheartland
Enthusiast
Enthusiast

I'm not really sure. How long is your vm name? Keep in mind there is a limit of 15 chararacters, so if you .companyname.com extends in to the 15 character range it's going to be cutoff anyway. But, there may be another limitation I'm not aware of i.e. vcenter/vcac/javascript can't compile "." in the name.

Also, can you confirm that to update your host name you're using the workflow "update a vcac model entity" and not the "addupdateproperty" action like you would for network name or other properties?

Reply
0 Kudos
VMANALYST
Enthusiast
Enthusiast

Attached is the child workflow where I am setting the properties using the plugin workflow.

Regards

Pankaj

Reply
0 Kudos
chrisheartland
Enthusiast
Enthusiast

Ok I would make these changes to your "Update VM and Host Name" workflow.

First, in your code in scriptable task "hostname property", remove the "" quotes from "VirtualMachineName" and "VMDNSName" and make them just VirtualMachineName and VMDNSName.

Second, remove the "update hostname" action and remove attibute "propHostnameName". That is not needed to update a hostname. The only workflow that is needed is "update a vcac model entity" which you have as your 2nd element. Be sure to also set a variable for "updatedEntity" in the "OUT" tab of the workflow. Just set it as an attribute with name "updatedEntity".

Edit: Oh, and make sure you don't have a custom property in the blueprint called "Hostname" either. If so delete it.

Reply
0 Kudos
VMANALYST
Enthusiast
Enthusiast

I did the change but Same result it simply removes "." from the DNS name on vcenter vm. The virtual Machine Name is setting up correctly it is "comu.test.company.com".

I am setting the value as "comu.test.company.name" this is real data which I am running.

Regards

Pankaj

Reply
0 Kudos
VMANALYST
Enthusiast
Enthusiast

Tried setting "test.local" but same result it simply removes "." . VM Name is set up correctly.

Regards

Pankaj

Reply
0 Kudos
chrisheartland
Enthusiast
Enthusiast

Again, If I'm understanding correctly, you won't be setting an FQDN this way in the first place. FQDN is made up of hostname + domain name. Your domain name is received from the domain you are in. If you are on a domain and have DNS set up (DDNS in the case of AD), then your vm will automatically get the FQDN based upon that.

If your vm name is "test123", when you join the domain and it's registered in DNS the FQDN will become "test123.company.com" automatically.

Reply
0 Kudos
VMANALYST
Enthusiast
Enthusiast

I agree , but That is why I was setting the Hostname , VirtualMachineName and DNSName as "testvalue" and I am setting the value of VirtualMachine.Network0.DNSSuffix as "test.company.value" . This according to me should automatically convert into FQDN. Please correct me if I am wrong anywhere.

Regards

Pankaj

Reply
0 Kudos
chrisheartland
Enthusiast
Enthusiast

I believe that is correct or at least how I would understand how it should work. Your VM name + dnssuffix = FQDN. I'm not sure what happens if you put whatever DNSSuffix in you want if your actual domain name is different. LIke, can you put in dnssuffix "ABC.com" if your actual domain is "XYZ.com"? Is that what you are trying to do?

Reply
0 Kudos
VMANALYST
Enthusiast
Enthusiast

I get the complete the HostName from the External IPAM solution as "testvalue.ABC.COM"  basis of whatever I dnsview I pass to IPAM .

I put "testvalue" as VMNAME, HOSTNAME and VirtualMachineName and "ABC.com" into "VirtualMachine.Network0.DNSSuffix".

Regards

Pankaj

Reply
0 Kudos
chrisheartland
Enthusiast
Enthusiast

Ok. I don't know why you need dnssuffix in the first place. When you join the computer to the domain it will automatically get the dns suffix added onto the name as that's the definition of a DNS name. The "hostname" i.e. "testvalue" is the netbios name and "testvalue.abc.com" is the DNS/fqdn name.

Reply
0 Kudos
VMANALYST
Enthusiast
Enthusiast

So you mean , we can not set DNS/FQDN  "testvalue.abc.com" during my Building Machine operation by just giving this value in "VMDNSName" ? I thought we can do it.

or It has to be done manually after the machine has been provisioned.

Regards

Pankaj

Reply
0 Kudos
chrisheartland
Enthusiast
Enthusiast

Again, my understanding of DNS and domains etc., yes that is correct. The only reason for a DNSSuffix is for the domain. so, when you join the domain whatever you put in the "DNSSuffix" property is what the DNS name will be. If you are not on a domain, you won't have a DNSSuffix, or so I believe. An AD guy can say if that's wrong or not.

Reply
0 Kudos