Issue
My Windows 2008 VM under XEN no longer has internet access, the network interface won't come up and is only accessible through the console. How can I fix this?
Environment
All OnApp versions
Solution
If the network fails on a Windows VM, it is recommended that you update the XEN network driver. Check which version of the driver the VM is running. If the xennet driver version is already the latest, or it is showing as a Realtek driver, please contact the support. Otherwise, do the following:
1. Make sure the VM is shut down and SSH to the HV the VM is located on.
2. Find the disk identifier. You can check any startup log for the VM for this. You'll see a line similar to step 4. The identifier in the line is qx9wsx4a14uxqg.
3. Then find the path to the disk on the HV. For example:
lvscan | grep qx9wsx4a14uxqg)
Should be something like:
/dev/onapp-yoa7hk9k1m3deg/qx9wsx4a14uxqg
4. Do the following with the path:
kpartx -p X -a /dev/onapp-yoa7hk9k1m3deg/qx9wsx4a14uxqg
Then check if the new devices were created:
ls -al /dev/mapper/ | grep qx9wsx4a14uxqg
Should be something like: qx9wsx4a14uxqgX1
Full path will be (pay attention to the path. It isn't the same as /dev/onapp-yoa7hk9k1m3deg/blablabla):
brw-rw---- 1 root disk 253, 34 Aug 30 11:04 /dev/mapper/qx9wsx4a14uxqgX1
5. Then, just mount it to the temp dir:
mkdir /tmp/1/ mount -t ntfs-3g /dev/mapper/qx9wsx4a14uxqgX1 /tmp/1/
6. After the disk is mounted, cd to /tmp/1/ and download the latest XEN driver version from http://templates.repo.onapp.com/Windows/gplpv_Vista2008x64_signed_0.11.0.373.msi to the problematic VM.
7. Create a bat file to uninstall old drivers:
net stop shutdownmon ping -n 5 127.0.0.1 if exist "%ProgramFiles%\Xen PV Drivers\" ( "%ProgramFiles%\Xen PV Drivers\bin\ShutdownMon.exe" -u ping -n 5 127.0.0.1 rmdir /q /s "%ProgramFiles%\Xen PV Drivers" ) if exist "%ProgramFiles(x86)%\Xen PV Drivers\" ( "%ProgramFiles(x86)%\Xen PV Drivers\bin\ShutdownMon.exe" -u ping -n 5 127.0.0.1 rmdir /q /s "%ProgramFiles(x86)%\Xen PV Drivers" ) del /q "%SystemRoot%\system32\drivers\xen*" for /F "delims=. tokens=1" %%I IN ('dir /B "%SYSTEMROOT%\INF\OEM*.INF"') do ( type "%SYSTEMROOT%\INF\%%I.inf" | find /c /i "xen" >%TEMP%\xenpv for /f %%c IN (%TEMP%\xenpv) do ( if /I %%c NEQ 0 ( del "%SYSTEMROOT%\INF\%%I.inf" del "%SYSTEMROOT%\INF\%%I.pnf" ) ) ) REG DELETE HKLM\SYSTEM\CurrentControlSet\Services\XenHide /f REG DELETE HKLM\SYSTEM\CurrentControlSet\Services\XenNet /f REG DELETE HKLM\SYSTEM\CurrentControlSet\Services\XenPCI /f REG DELETE HKLM\SYSTEM\CurrentControlSet\Services\XenScsi /f REG DELETE HKLM\SYSTEM\CurrentControlSet\Services\XenUSB /f REG DELETE HKLM\SYSTEM\CurrentControlSet\Services\XenVbd /f REG DELETE HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E96A-E325-11CE-BFC1-08002BE10318} /v UpperFilters /f REG DELETE HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318} /v UpperFilters /f REG DELETE HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E97B-E325-11CE-BFC1-08002BE10318} /v UpperFilters /f
ECHO Done
----------------------------------------------
After downloading the data properly, umount the disk and complete the update:
1. Umount temp dir:
umount /tmp/1/
2. And run this command:
kpartx -p X -d /dev/onapp-yoa7hk9k1m3deg/qx9wsx4a14uxqg
3. Start the problematic VM
4. Run the bat file
5. Reboot
6. Install new driver
7. Reboot again (you may need to reboot twice)
8. Check if the network settings (IP address, subnet mask, etc.) are set correctly. If everything is fine, the network will be restored for the VM.