Difference between revisions of "Creating a CentOS\Red Hat VMware template"
(Created page with "One of the good things about VMware is that you can create an OS template. That's a complete pre-configured VM that you can use to create other machines from. However, you can...") |
(No difference)
|
Revision as of 06:39, 8 February 2012
One of the good things about VMware is that you can create an OS template. That's a complete pre-configured VM that you can use to create other machines from. However, you can get into a little bit of trouble with CentOS/Red Hat, in particular with networking. When creating a template, you first build a VM, install an OS, configure it the way you like it and then convert it into a template. When you convert a CentOS/Red Hat VM into a template it will keep the virtual NIC MAC address of the original VM you created it from. As such, when you build other VM's from this template, they will have incorrect MAC addresses for their virtual NIC's. Here's how to make sure this doesn't happen.
Make sure the template is correct
The last steps before converting the VM into a template should be:
1. Edit any ifcfg-ethX files, in /etc/sysconfig/netwrok-scripts/, that you may have and delete the MAC address lines, i.e. HWADDR=XX:XX:XX:XX:XX:XX
2. Edit /etc/udev/rules.d/70-persistent-net.rules and delete any lines that have a MAC address in them.
Example:
# PCI device 0x8086:0x1076 (e1000) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0e:0c:07:75:dd", ATTR{type}=="1", NAME="eth0" # PCI device 0x8086:0x103a (e100) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0e:a6:35:9c:be", ATTR{type}=="1", NAME="eth1"
NOTE: Don't worry, this will be automatically re-created when you start the new VM.
3. Shutdown the VM and convert into a template immediately.
NOTE: If you have to reboot for any reason before converting this VM into a template, you will have to repeat step 2.