Thursday, August 16, 2012

Device eth0 does not seem to be present, delaying initialization


Cloned VMware Fedora 13 Server and "device eth0 does not seem to be present, delaying initialization" Error

Recently, I cloned a vmware install of Fedora 13 and after firing up the clone and trying to start networking received the error: "device eth0 does not seem to be present, delaying initialization"

It turns out that the NIC on the cloned machine was being renamed and registered to eth1.

To list the current ethn devices:

# ls /sys/class/net
eth1 lo

There is a device manager, udev, which stores the settings from the NIC of the vm prior to the cloning? process.? When you clone a vm it also changes the mac address of the NIC and as a result the vm sees it as a new NIC and assigns it to /dev/eth1.

As a result, we now have to edit the udev config file as well as the ifcfg-eth0 file to get the newly update virtual NIC card to operate on the eth0 device.

First, edit: /etc/udev/rules.d/70-persistent-net.rules

# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x15ad:0x07b0 (vmxnet3) (custom name provided by external tool)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:bc:00:45", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
### Delete this line

# PCI device 0x15ad:0x07b0 (vmxnet3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:bc:00:46", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
### Change eth1 to eth0

Delete the first SUBSYSTEM entry in the file.

Update the 'eth1' attribute in the remaining entry to 'eth0'

Edit /etc/sysconfig/network-scripts/ifcfg-eth0

Change the HWADDR to match the new mac address listed in the newly edited 70-persistent-net.rules file.
reboot. And network restart.

Source : http://www.ryanchapin.com/fv-b-4-655/Cloned-VMware-CentOS6-Server-and--quot-device-eth0-does-not-seem-to-be-present--delaying-initialization-quot--Error-.html

Friday, August 10, 2012

Copy remote content in vi editor

You can copy content from one file to another file by using vi editor.
Say for Ex: you need to copy the content of test1 file to test2 file.
vi test2 file
then Esc key and : key
type below command.
r ! cat /root/test1

Tuesday, August 7, 2012

Cloning Virtual Machine in VMware ESXI


To clone a virtual machine disk using the ESX host terminal:
  1. Log into the VMware ESXI host's terminal.
  2. Navigate to the virtual machine's directory using the cd command. It is located at:

    /vmfs/volumes/datasotre1/virtual_machine_name/
  3. Confirm the destination directory where the clone will be copied to. Create this directory, if required.

    For example, if this destination directory does not exist:

    /vmfs/volumes/datastore1/virtual_machine_name/
    (Refer = clone)

    Create the directory using this command:

    mkdir /vmfs/volumes/datastore1/virtual_machine_name/
    (Refer = test)
  4. Clone the virtual hard disk using the vmkfstools -i command:

    # vmkfstools -i "/vmfs/volumes/datastoer1/clone/clone.vmdk" /vmfs/volumes/datastore1/test/test.vmdk

    Note: Encapsulate objects with quotes where appropriate to ensure spaces and other special characters are interpreted correctly.

    The output appears similar to:

    Destination disk format: VMFS thick
    Cloning disk '/vmfs/volumes/datastore1/test/test.vmdk'...
    Clone: 100% done.
  1. Then log on using VMware vSphere client and create Virtual machine using Existing Hardisk.
  2. Finally point out the test.vmdk Hard Disk to create the virtual machine. Within 10 minutes time you can finish the process.

Source : http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1027876