# Vmware CentOS 6 Contextualization

**URL:** <https://forum.opennebula.io/t/vmware-centos-6-contextualization/3967>\
**Category:** Product Support\
**Created:** [March 13, 2017, 11:28pm UTC](https://forum.opennebula.io/t/vmware-centos-6-contextualization/3967 "2017-03-13T23:28:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![serverx](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@serverx](https://forum.opennebula.io/u/serverx)\
**Post date:** [March 13, 2017, 11:28pm UTC](https://forum.opennebula.io/t/vmware-centos-6-contextualization/3967/1 "2017-03-13T23:28:35Z")

</div>

Hello im getting a problem that i couldn’t solve, basically i created a vm with centos 6, and as described here [https://docs.opennebula.org/5.2/operation/vm\_setup/kvm.html](https://docs.opennebula.org/5.2/operation/vm_setup/kvm.html)  
I installed one-context\_5.0.3.rpm then i executed:

yum install -y epel-release  
yum install ruby  
yum install -i dracut-modules-growroot  
dracut -f

i removed the network card and i converted the vm into a template, so i imported the template into opennebula and i created the following contextualization

CONTEXT = [  
ETH0\_DNS = “$ETH0\_DNS”,  
ETH0\_GATEWAY = “$ETH0\_GATEWAY”,  
ETH0\_IP = “$ETH0\_IP”,  
ETH0\_MASK = “$ETH0\_MASK”,  
ETH0\_SEARCH\_DOMAIN = “[server.domain.com](http://server.domain.com)”,  
PASSWORD = “$PASSWORD”,  
SET\_HOSTNAME = “$SET\_HOSTNAME”,  
START\_SCRIPT = “yum install -y ntpdate” ]  
CPU = "1"  
DESCRIPTION = "Template CentOs 6 - 64bit"  
GRAPHICS = [  
KEYMAP = “en”,  
LISTEN = “0.0.0.0”,  
TYPE = “VNC” ]  
HYPERVISOR = "vcenter"  
KEEP\_DISKS\_ON\_DONE = "NO"  
LOGO = "images/logos/centos.png"  
MEMORY = "1024"  
NIC = [  
NETWORK = “Public Switch- C”,  
NETWORK\_UNAME = “oneadmin” ]  
PUBLIC\_CLOUD = [  
TYPE = “vcenter”,  
VM\_TEMPLATE = “42347588-55f3-8268-d355-bfed963f3491” ]  
RESOURCE\_POOL = "VPS"  
SCHED\_REQUIREMENTS = "NAME=“Cluster”"  
USER\_INPUTS = [  
ETH0\_DNS = “M|text|Server DNS”,  
ETH0\_GATEWAY = “M|text|Server Gateway”,  
ETH0\_IP = “M|text|Server Ip”,  
ETH0\_MASK = “M|text|Server SubnetMask”,  
PASSWORD = “M|password|Root Password”,  
SET\_HOSTNAME = “M|text|Server Hostname” ]  
VCENTER\_DATASTORE = "STORAGE01"  
VCPU = “1”

I set into my contextualization the “User Inputs” that will populate the network details of the server such ip, dns, gateway etc…  
But after create the vm based on the template and contextualization the vm have the ip address of the centos installation and not the ip address and network details  
as specified during the vm creation… just the password is correct, what im doing wrong ?

I saw also that when im starting the VM from the console i can see the following errors:

growroot: /dev/dm-0 is not a partition  
Welcome to CentOS  
start udev: udevd[451]: can not read '/etc/udev/rules.d/75-cd-aliases-generator.rules’  
udevd[451]: can not read ‘/etc/udev/rules.d/75-cd-aliases-generator.rules’

udevd[451]: can not read '/etc/udev/rules.d/75-persistent-net-generator.rules’  
udevd[451]: can not read ‘/etc/udev/rules.d/75-persistent-net-generator.rules’

Thanks for help

---

<div class="post-metadata">

**Author:** ![jfontan](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/jfontan/32/18_2.png) [@jfontan](https://forum.opennebula.io/u/jfontan)\
**Post date:** [April 24, 2017, 9:02am UTC](https://forum.opennebula.io/t/vmware-centos-6-contextualization/3967/2 "2017-04-24T09:02:00Z")

</div>

The context script need `ETH0_MAC` to search for the correct network interface. I believe this could work if you add to the context:

```auto
ETH0_MAC="$NIC[MAC,NIC_ID=0]"

```

Why don’t you let OpenNebula fill those values using `NETWORK="YES"` in context?

---

<div class="post-metadata">

**Author:** ![serverx](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@serverx](https://forum.opennebula.io/u/serverx)\
**Post date:** [October 10, 2017, 10:18pm UTC](https://forum.opennebula.io/t/vmware-centos-6-contextualization/3967/3 "2017-10-10T22:18:26Z")

</div>

no way… i tried to add  
ETH0\_MAC="$NIC[MAC,NIC\_ID=0]"  
but the centos vm still not changing ip…

if i set NETWORK=“YES” in context how i can declare the vm ip during the provisioning?  
Thanks
