2011/01/10

Copy virtual machine on VmWare - network card issue

CURRENT CONFIGURATION: VMware ESXi 4, Ubuntu server 10.04
OBJECTIVE: Copy virtual machine on VMware
ISSUE: Network Card does not work after Linux virtual machine copy on VMware ESXi
 # /etc/init.d/networking restart
 * Reconfiguring network interfaces...
SIOCSIFADDR: No such device
eth0: ERROR while getting interface flags: No such device
SIOCSIFNETMASK: No such device
eth0: ERROR while getting interface flags: No such device
Failed to bring up eth0.
stop: Unknown instance:
# ifconfig -a
eth0_rename Link encap:Ethernet  HWaddr 00:00:xx:00:xx:00
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
All NIC are installed. Check command is
# lshw -C network
SOLUTION: 
to comment all lines in /etc/udev/rules.d/70-persistent-net.rules
# vi /etc/udev/rules.d/70-persistent-net.rules
Example:
# PCI device 0x8086:0x100f (e1000)
# SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:00:00:00:xx:01", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x100f (e1000)
# SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:00:xx:00:00:02", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
Please reboot the Ubuntu server on VMware ESXi.

For Ubuntu server clone (image) creation (moving preparation) use next command on master clone (Source server) before final poweroff (shutdown).
sed -i 's/SUBSYSTEM/#SUBSYSTEM/g' /etc/udev/rules.d/70-persistent-net.rules

upgrade to VMvare ESXi 4.1 Perl VIRuntime.pm issue

CURRENT CONFIGURATION: VMware ESXi 4.0
OBJECTIVE: upgrade to VMvare ESXi 4.1
ISSUE:
1. VMware vSphere Host Update Utility 4.0 can not update ESXi 4.0 to 4.1
2. Command(1) C:\Program Files\VMware\VMware vSphere CLI> vihostupdate.pl --server myESXserver_name_orIP -i -b k:\Downloads\VMWare\VMWare_ESXi\ESXi4.1\upgrade-from-ESXi4.0-to-4.1.0-0.0.260247-release.zip -B ESXi410-GA
returns next error message
Can't locate VMware/VIRuntime.pm in @INC (@INC contains: C:/My_different_perl_version_installation/Perl/site/lib C
:My_different_perl_version_installation/Perl/lib .) at C:\Program Files\VMware\VMware vSphere CLI\bin\vihostupdat
e.pl line 13.
BEGIN failed--compilation aborted at C:\Program Files\VMware\VMware vSphere CLI\
bin\vihostupdate.pl line 13.
 3. When you had renamed previously installed Perl Folder command(1) would return next window
4. When you added Perl with full patch to command(1) command(2) would return next error message:
Can't open perl script "vihostupdate.pl": No such file or directory
SOLUTION:
1. Download  and install VMware vSphere
2. If you have previously installed Perl please rename Perl installation directory temporary. Example: From  C:/My_different_perl_version_installation/ to C:/__My_different_perl_version_installation/
3. Add Perl with full patch to command(1). Would be command(2)  
C:\Program Files\VMware\VMware vSphere CLI> "c:\Program Files\VMware\VMware vSphere CLI\Perl\bin\perl.exe" vihostupdate.pl --server myESXserver_name_orIP -i -b k:\Downloads\VMWare\VMWare_ESXi\ESXi4.1\upgrade-from-ESXi4.0-to-4.1.0-0.0.260247-release.zip -B ESXi410-GA
4. Use full path for Perl and vihostupdate.pl. Would be command(3)
C:\Program Files\VMware\VMware vSphere CLI> "c:\Program Files\VMware\VMware vSphere CLI\Perl\bin\perl.exe" "c:\Program Files\VMware\VMware vSphere CLI\bin\vihostupdate.pl" --server myESXserver_name_orIP -i -b k:\Downloads\VMWare\VMWare_ESXi\ESXi4.1\upgrade-from-ESXi4.0-to-4.1.0-0.0.260247-release.zip -B ESXi410-GA
SOLUTION BOTTOM LINE:
If you have previously installed Perl please rename Perl installation directory temporary.
Use full path for Perl and vihostupdate.pl. Would be command
C:\Program Files\VMware\VMware vSphere CLI> "c:\Program Files\VMware\VMware vSphere CLI\Perl\bin\perl.exe" "c:\Program Files\VMware\VMware vSphere CLI\bin\vihostupdate.pl" --server myESXserver_name_orIP -i -b k:\Downloads\VMWare\VMWare_ESXi\ESXi4.1\upgrade-from-ESXi4.0-to-4.1.0-0.0.260247-release.zip -B ESXi410-GA

To VMware: Thanks for nice exercise.