ZenalBill Super Contributor.
Super Contributor.
919 views

VMWare content pack - Set IP on customization template xml

Hello,

 

I'm using the VMWare content pack for and trying to deploy a VM (clone from template) with everything as it is out of the box except for the customization template which I'm trying to use an XML one.

 

It is reading the XML fine, accepting its format, it's setting everything I've put in it (VM admin password, org name, etc) except for the IP address. I need the ip to be given by a variable and so I thought the only way to do this would be through the customizationspecXML but it just gives the VM some random IPv6 when it ends deploying (probably some setting on VMWare doing this). This is the xml bit for the nicsettings:

<nicSettingMap>

<_length>2</_length>

<_type>vim.vm.customization.AdapterMapping[]</_type>    <e id="0">

<_type>vim.vm.customization.AdapterMapping</_type>

<adapter>

<_type>vim.vm.customization.IPSettings</_type>

<dnsServerList>

<_length>1</_length>

<_type>string[]</_type>            <e id="0">255.255.255.255</e>

</dnsServerList>

<gateway>

<_length>2</_length>

<_type>string[]</_type>            <e id="0">255.255.255.255</e>            <e id="1"/>

</gateway>

<ip>

<_type>vim.vm.customization.FixedIp</_type>

<ipAddress>192.168.0.1</ipAddress>

</ip>

<primaryWINS/>

<secondaryWINS/>

<subnetMask>255.255.255.0</subnetMask>

</adapter>

</e>

</nicSettingMap> 

 

Has anyone had the need to do this and done it ?

 

Thanks all

Labels (2)
0 Likes
11 Replies
mostafa_hassan Outstanding Contributor.
Outstanding Contributor.

Re: VMWare content pack - Set IP on customization template xml

Hello ,

You need to do the customisation specs in VMware vcenter, I have done this for CSA computing windows and Linux VM's which are passing these variables to OO .

Regards
Mostafa Hassan
Regards
Mostafa Hassan
--------------------------------------
If my post helped you, kindly click the 'Kudos' button.
0 Likes
ZenalBill Super Contributor.
Super Contributor.

Re: VMWare content pack - Set IP on customization template xml

Hello,

 

How so ? It's for exactly that that I need it, also using it for CSA vware windows and linux deploys.

 

But how did you do it ? Using the customizationspecification xml ?

0 Likes
mostafa_hassan Outstanding Contributor.
Outstanding Contributor.

Re: VMWare content pack - Set IP on customization template xml

So have you tried to created custom specs in component template , the display name should match what you have configured in Vcenter 

 

attached example .

Regards
Mostafa Hassan
--------------------------------------
If my post helped you, kindly click the 'Kudos' button.
0 Likes
ZenalBill Super Contributor.
Super Contributor.

Re: VMWare content pack - Set IP on customization template xml

Sorry but don't understand what you mean.

 

You mean create a customization specification on vcenter? You create one for each machine you deploy with different IPs configured in each?

0 Likes
mostafa_hassan Outstanding Contributor.
Outstanding Contributor.

Re: VMWare content pack - Set IP on customization template xml

no what i mean that there will be customization profile for each type of OS , like windows OS or Linux 

 

for each profile there will be network settings that can be assigned , attached how to get to Customization specifications 

Regards
Mostafa Hassan
--------------------------------------
If my post helped you, kindly click the 'Kudos' button.
ZenalBill Super Contributor.
Super Contributor.

Re: VMWare content pack - Set IP on customization template xml

Oh ok, sorry I know what you meant now.

 

That is where I got the XML, I created a customization specification, put custom network config on it with some random IP and exported it to an XML file which has the NIC settings that I posted above.

 

What you are suggesting doesn't work because then all VMs would have the same IP no ? Or get it via DHCP which doens't work here, the IP for the VM is a variable on the flow.

 

The IP I'm getting from a DBs of IPs at the beggining of the deploy VM flow.

0 Likes
mostafa_hassan Outstanding Contributor.
Outstanding Contributor.

Re: VMWare content pack - Set IP on customization template xml

There is an option "prompt the user for an address when the specification is used" in custom network settings .

i didn't test it yet ,  i am not sure that if would work or not .

 

i will ask for every config except ip address , i guess that what you are looking of .

 

 

Regards
Mostafa Hassan
--------------------------------------
If my post helped you, kindly click the 'Kudos' button.
0 Likes
ZenalBill Super Contributor.
Super Contributor.

Re: VMWare content pack - Set IP on customization template xml

I honestly don't even know how to test that because the prompt is on Vcenter and deploy is done by OO...

 

Can't see how that prompt would recieve input from an OO variable.

 

 

0 Likes
ZenalBill Super Contributor.
Super Contributor.

Re: VMWare content pack - Set IP on customization template xml

And like I said, I can't use a customization specification saved on Vcenter, i need to use the input of that customspec to be the XML for it because of many variables I need to fill it with.

 

Organization name, admin password that I need to generate into a variable, commands to run once at deploy, IP settings, etc. All those inputs are different for each VM I deploy, the deploy VM flows have that option, to either use a customspec saved on vCenter or use an XML custom spec. I must use that XML.

 

The problem is what i said above, it's accepting it, implementing all of the values I put in it except for the IP.

0 Likes
mostafa_hassan Outstanding Contributor.
Outstanding Contributor.

Re: VMWare content pack - Set IP on customization template xml

oh now i got what you are facing , i have generated custom specs in vcenter and exported them to xml file .

 

<nicSettingMap>
<_length>1</_length>
<_type>vim.vm.customization.AdapterMapping[]</_type>
<e id="0">
<_type>vim.vm.customization.AdapterMapping</_type>
<adapter>
<_type>vim.vm.customization.IPSettings</_type>
<dnsServerList>
<_length>1</_length>
<_type>string[]</_type>
<e id="0">4.2.2.2</e>
</dnsServerList>
<gateway>
<_length>2</_length>
<_type>string[]</_type>
<e id="0">192.168.0.1</e>
<e id="1"/>
</gateway>
<ip>
<_type>vim.vm.customization.FixedIp</_type>
<ipAddress>192.168.0.20</ipAddress>
</ip>
<primaryWINS/>
<secondaryWINS/>
<subnetMask>255.255.255.0</subnetMask>
</adapter>
</e>
</nicSettingMap>

 

Check the gateway you have set it to 255.255.255.255 and try to change the fixed ip address to another ip .

Regards
Mostafa Hassan
--------------------------------------
If my post helped you, kindly click the 'Kudos' button.
0 Likes
ZenalBill Super Contributor.
Super Contributor.

Re: VMWare content pack - Set IP on customization template xml

I have already tried it with many values...it always ignores what i'm setting there and gives the VM some random ipv6 that not even on vcenter is configured to do that.

 

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.