Quantcast
Channel: VMware Communities : All Content - vSphere Management SDK
Viewing all articles
Browse latest Browse all 1860

Problem with host name setting when customize a Linux VM

$
0
0

 

I am customizing an existing vm with Linux OS cloned by VC with VMWare SDK. In the customization, I want to set the host name of that vm in the form of FQDN. I can successfully set the host name as “host1” for example. When I power on that vm , I can see that the host name “host1” is set in the file /etc/hostname. However, when I set the host name as “host1.company1.com” for example, I came across the following error message:

A specified parameter was not correct. spec.identity.hostName”.

 

 

 

The snip of the code :

 

 

 

CustomizationFixedName fixedHostName = new CustomizationFixedName(); CustomizationLinuxPrep custLinuxPrep = new CustomizationLinuxPrep(); fixedHostName.setName(“host1.company1.com”);//for exmple custLinuxPrep.setHostName(fixedHostName); custLinuxPrep.setDomain(“company1.com”);… CustomizationSpec customsSpec = new CustomizationSpec();… customsSpec.setIdentity(custLinuxPrep);…service.customizeVMTask(vmMOR, customsSpec);

 

Really appreciated for your help!

 

 


Viewing all articles
Browse latest Browse all 1860

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>