P2V Conversion of Linux Virtual Machine (for XenServer)

With XenServer 5.6 Citrix removed the old Linux P2V tool which was included in earlier versions of XenServer. The old version 5.5 tool will not work with XenServer 5.6, and only supported older distributions.

For this reason is may be desirable to manually convert a Linux physical machine to a XenServer VM. This document attempts to provide a general guide to completing this process.

Move system image to VM

There are several ways to do this. Any tool which can copy the blocks or the filesystem from one “bare metal” machine to another will work. You can use a live CD like Knoppix, or the “System Rescue CD” or commercial utilities like Ghost or even PortLock storage Manager. Most linux distributions also have a “recovery” mode from the install media which can also be used for this. If your machine is a VM from another platform you can convert the disk to a VHD or an OVF and simply import that.

In this example we’re going to use a basic live CD, and the DD utility to move the block image intact to the new VM. As always there is more than one way to skin this particular cat.

media_1302803692674.png

Once you’ve booted your live CD, Verify where your fileystems are at. In this particular case our root filesystem is at /dev/sda3 and the /boot filesystem is at /dev/sda1

Make sure that these are the real fileystems of the machine you’re wanting to convert. The example above might not match your environment!

Knowing where these are at is critical. Depending on the live CD and your particular partitoining/LVM layout your configuration may be different.

media_1302803939355.png

We want to capture our current partition information, and the size of the source disk. Our target disk will need to be as large or larger than the source.

media_1302803598113.png

Get yourself some space to work with. Above we created a mount point /mnt/nfs and attached to some handy NFS storage, but you could also use a CIFS based fileshare, or with a little creativity the need for the disk space can be mitigated through use of an SSH tunnel.

media_1302804045508.png

Use dd to copy the harddisk to an image on the NFS server. Note that dd does not produce any output until the job is complete. Sending a hup signal to the process will give you some progress information however.

If possible, it’s always cleanest to dismount or make sure the fileystems are not mounted before you start the dd process. Failure to do so can result in corrupted filesystems on the target.

media_1302804930087.png

When the dd is complete, we can shutdown the source system.

Create target virtual machine and restore the image

media_1302805131506.png

Use the other install media to create a HVM mode virtual machine which we’ll transfer your image into. Complete the wizard configuring RAM, CPU, and Networking to your needs. Make sure you configure the storage to match the size of the original machine’s disk.

media_1302805363470.png

Make sure your storage is correct. Mount your live CD on to the VM.

media_1302810855819.png

Boot the VM from the live CD and confirm that you see the VM’s hard disk and that it’s the correct size.

media_1302811142656.png

mount the file share, and reverse the dd command to write the image onto the virtual machine’s hard disk.

media_1302811566327.png

When dd completes, reboot the VM and eject the CD.

media_1302811736977.png

Ok, so far so good, the VM booted the transplanted OS. Now we just need to convert the HVM to a PVM and enable the XenServer tools.

Converting the HVM into a PVM mode virtual machine.

HVM based virtual machines work by emulating physical hardware and allow unmodified guests to run on top of XenServer. Such machines allow operating systems like Windows which cannot be modified to boot and run on XenServer.

PVM based virtual machine work by way of sharing physical devices in an intelligent manner made possible by the virtual machine’s awareness that it is a VM. This requires modification of the system’s kernel and device drivers. PVM mode guests are almost exclusively Linux based.

media_1302811997834.png

Start by checking the virtual machine’s filesystems – note that we are currently booting from /dev/hda# indicating emulated hardware.

Knowing that we’re on emulated hardware, and now knowing where our volumes live we can start modifying the operating system to run on paravirtualized hardware.

media_1302812378131.png

modify /etc/modprobe.conf (or your distribution’s equivalent) to include the xen modules for storage and networking. You can also probably remove the old hardware modules if present.

vi /etc/modprobe.conf
alias scsi_hostadapter xenblk
alias eth0 xennet

media_1302812529471.png

Install the Xen-aware kernel for your distribution. This will be something similar to “yum install kernel-xen”

Make not of the kernel version which is installed.

Update the bootloader configuration so that the new kernel is the default, and that the bootloader is configured properly for Xen. Note the before and after screenshots below.

media_1302812730838.png

Before

media_1302812848950.png

After – the changes are highlighted above.

media_1302813078428.png

Rebuild the initrd including directives to preload the xen driver modules. Note that you MUST build this appropriately to the kernel version you just installed.

One the initrd has been rebuilt, shut down the os cleanly.

media_1302813395749.png

Activity now moves to the console of the Xen Host. You can do this within the console provided by XenCenter, or from a ssh session.

Use the xe vm-list command to determine the uuid of the virtual machine you’re working on. We want to modify this VM to be a PVM mode guest rather than a HVM mode one.

media_1302815164822.png

Update VM Parameters to enable PVM mode
xe vm-param-set uuid=<vm uuid> HVM-boot-policy=”"
xe vm-param-set uuid=<vm uuid> PV-bootloader=pygrub
xe vm-param-set uuid=<vm uuid> PV-bootloader-args=”–kernel <path to kernel> –ramdisk <path to xen initrd>”
xe vm=param-set uuid=<vm uuid> PV-args=”root=/dev/xvda#”

media_1302814138370.png

Obtain the UUID of the virtual machine’s boot disk using the xe vm-disk-list command. The UUID supplied is the UUID of the virtual machine.

You now want the VBD UUID for the boot disk.

media_1302814281585.png

Mark the VBD as bootable using the xe vbd-param-set uuid= command as shown above.

Restart XenCenter

For unknown reasons it is necessary that XenCenter be restarted at this point. Exit and restart XenCenter.

Failure to do so will prevent you from seeing the console of the VM when it’s powered on.

media_1302814961319.png

Check the properties of the VM, and make sure that the HD is set as the only boot device for the VM. Then power on the virtual machine.

This is the point where we will find what mistakes have been made – if the system panics, double check your boot device/paths/etc.

media_1302815219472.png

The system is up on the Xen Kernel

media_1302815300232.png

The fileystems are up on the paravirtual devices as well.

media_1302815239419.png

However XenCenter does not yet report that we are running fully paravirtualized, and features such as live migration will not yet be available.

media_1302815467647.png

Mount the xs-tools.iso to the virtual machine, and then mount the cdrom within the vm.

media_1302815538457.png

Install the XenServer tools

media_1302815580074.png

The tools are now installed.

media_1302815607470.png

Now XenCenter will report the system as being optimized, and live migration is available.

Reboot the virtual machine and eject the CDROM.

Networking

media_1302815750270.png

One last issue may exist depending upon the configuration of the network adapter. Shown above eth0 is down.

You will need to ‘fix’ the networking config for your distribution. For RHEL/CentOS the relevant configuration lives under /etc/sysconfig/network-scripts in a file named ifcfg-eth0

This file must exist, it may have been renamed (.bak) if so copy it back then modify the copy.

media_1302816129025.png

Remove or comment the HWADDR line and save the file.

media_1302816212678.png

Restart the network to bring the interface online.

media_1302816303991.png

This completes the conversion. Your linux system is now a XenServer paravirtualized virtual machine.

Summary cheat sheet

Remove any attached CDs

Boot the imported VM
vi /etc/modprobe.conf adding
alias scsi_hostadapter xenblk
alias eth0 xennet

yum install kernel-xen

Update /boot/grub/grub.conf
Make the Xen Kernel the default for boot
Make note of the kernel and initrd file names
Modify grub.conf to be similar to the below
title CentOS (2.6.18-128.2.1.el5xen)
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-128.2.1.el5xen ro root=LABEL=/
initrd /boot/initrd-2.6.18-128.2.1.el5xen.img

Make new Xen initrd
mkinitrd -v -f –preload=xennet –preload=xenblk /boot/initrd-2.6.18-128.el5xen.img 2.6.18-128.el5xen

shutdown the VM

Find uuid of the VM (b6ebbe09-2bcb-5c40-0f98-f33426487142)
xe vm-list

Update VM Parameters
xe vm-param-set uuid=<vm uuid> HVM-boot-policy=”"
xe vm-param-set uuid=<vm uuid> PV-bootloader=pygrub
xe vm-param-set uuid=<vm uuid> PV-bootloader-args=”–kernel <path to kernel> –ramdisk <path to xen initrd>”
xe vm=param-set uuid=<vm uuid> PV-args=”root=/dev/xvda#”

Find UUID of boot disk
xe vm-disk-list uuid <vm uuid>
… looking for the vBD UUID of disk0

Set the disk VBD to bootable
xe vbd-param-set uuid=<vbd uuid> bootable=true

exit and restart XenCenter console (odd bug)

Check the boot settings for the VM, make sure only hard-disk (HD) is selected.

Start the VM

install XenServer tools & reboot.

Backing Up ESX and vSphere Host Configurations with the Host Profile Feature

Back before vSphere, some very creative people/companies created utilities to backup all of the host configuration on your ESX servers. Things like Networking configuration, vSwitch configuration, Port groups, etc. Now with vSphere, how do you protect this information in case of a host failure/reinstall? Answer: Host Profiles.

It’s not really a “backup” per se, yet Host Profiles greatly simplify host configuration management in scale-out deployments through user-defined configuration policies. You can use profile policies to eliminate per-host manual host configuration and efficiently maintain configuration consistency and correctness across the entire datacenter.

An excellent recent post with additional links and such about Host Profiles can be found here:
http://communities.vmware.com/message/1376450;jsessionid=4944184E8F195FF105DF0BCF31114226

A great “how-to” type of blog post with Host Profiles can be found here:
http://malaysiavm.com/blog/esx-host-profiles-with-vsphere/

Hope it helps!

VMware vSphere – Using VMware Converter to Import VM’s or VMDK’s From Other VMware Products

When using Virtual Machines (VM’s) from other VMware products, the easiest way to get these VM’s into ESX/vSphere is to use VMware’s product called vCenter Converter Standalone. vCenter Server does include a version of Converter, however I’ve had better success in using the standalone version to do VM conversions as it is (typically) a newer version with more features than the one included with vCenter. This lesson describes how to use vCenter Converter Standalone to import VM’s or VMDK files from other VMware Products, such as VMware Fusion, VMware Workstation and VMware Server.

Powering On VM – Error with VMDK Files

We experienced the shown error when trying to power on a few virtual machines from a vendor of ours. I assumed that the VM’s were in ESX/vSphere format, but I guess they are not. It looks like we’ll need to convert the VMDK’s to the ESX/vSphere format so that we can use them.

Error Message:
Failed to find a host for powering on the Virtual Machine. The following faults explain why the registered host is not compatible.
Device ‘Hard Disk 1′ uses a controller that is not supported. This is a general limitation of the virtual machine’s virtual hardware version on the selected host.
Device ‘Hard Disk 2″ has a backing type that is not supported. This is a general limitation of the virtual machine’s virtual hardware version on the selected host.

Verifying the VMDK is not in an ESX/vSphere Format

We SSH’ed into the vSphere server and browsed to the VMFS datastore that holds our Virtual Machine. As shown in the screenshot, we can tell the VMDK is not an ESX/vSphere compatible VMDK for the following reasons:
1- There is no “-flat.vmdk” file, which all ESX/vSphere type of VMDK’s should have.
2- There are VMDK “slices” as shown in the screenshot (1). ESX/vSphere VMDK’s do not use this type of disk format (where other VMware products such as Workstation and Server do).
You can use VMware Converter to fix this issue by converting the VM to an ESX/vSphere compatible VM.

IDE VMDK – Not Supported in ESX/vSphere

An error that you might receive when using a VM from another product is:
An IDE controller is found but the virtual machine does not support the option.
The reason that this fails is that ESX/vSphere does not support IDE based Virtual Disks (VMDK’s) like the Desktop/Hosted products do. You can use VMware Converter to fix this error by converting the VM to an ESX/vSphere compatible VM.

Flat Backing Option Not Found

media_12615191101771.png

An error that you might receive when using a VM from another product is:
A flat backing option was not found.
The reason for this error is that ESX/vSphere is looking for a virtual disk file (VMDK) that actually points to a -flat.vmdk file. The Desktop/Hosted products do not use this type of Virtual Disk but ESX/vSphere does. You can use VMware Converter to fix this error by converting the VM to an ESX/vSphere compatible VM.

Sparse Backing Info Disk Option Not Found

Another error that you might receive when using a VM from another product is:
A SparseVer2BackingInfo disk is found but the virtual machine does not support the option.
This error is shown because this virtual disk uses a “sparse” feature on the virtual disk, so as not to take up a lot of space on the drive. Usually the VMDK file will also be “split” into multiple VMDK files that end in a -0001, -0002 and so on. This is done to limit the size of the VMDK. ESX/vSphere does very similiar options with VMDK files however it is done differently. This is the reason for the error shown. You can use VMware Converter to fix this error by converting the VM to an ESX/vSphere compatible VM.

Download VMware vCenter Converter Standalone Edition

First you’ll need to get vCenter Converter Standalone, which is available for FREE at the following location:
https://www.vmware.com/tryvmware/?p=converter
Once you’ve downloaded the program, install it on a server that you can use for the migrations. I usually install it on my vCenter server but that’s not a requirement. Once installed, go ahead and start vCenter Converter Standalone.

Convert Machine

Once the program starts, choose “Convert Machine” to get started.

Selecting Source for Conversion

First, select the source type, which in our case will be a “VMware Workstation or other VMware virtual machine” (1). Then browse to where the virtual machine is located at (2). This will need to be on a network share or on a local drive so that Converter can access the files. Then choose the Next button to proceed (3).

Selecting Destination for Conversion

Select the destination type, which in our case will be a “VMware Infrastructure Virtual Machine” (1). Then specify either an ESX/vSphere server or a vCenter Server along with the required login information for that host (2). Then select “Next” to proceed (3).

Now, specify the Virtual Machine name (1), the destination Datastore (2) and then click “Next” to proceed (3).
Note, that if you use “Version 7″ for the Virtual Machine hardware version, you will not be able to use this VM on anything but vSphere 4. If you need to use this VM on ESX 3.x then choose “Version 4″ for the Virtual Machine hardware version.

VM Options

This screen will show various options that you can specify for the newly created Virtual Machine. Your options may differ or you may want to change a few thinggs here depending on your environment. A couple of options that I normally select is under “Advanced Options” (1). Select the option to “Power on target Machine” (2) and to also “Install VMware Tools on the imported Virtual Machine” (3). This will automatically startup and install VMware tools on the new virtual machine after the cloning process is finished. Next, click on the “Next” button (4) to proceed.

Wizard Summary

A summary screen is displayed. If you need to edit any of the options on this screen, you’ll need to back up through the wizard to that specific area. If you are ready to proceed, click on the “Finish” button to begin the conversion process.

Running Conversion

You can check the status of the conversion by following the “Status” area for the conversion job. You can also use the “Task Progress” tab to see more detailed information about the conversion.

Conversion Completed

Once the conversion is completed, you’ll see the status of the job change to “Completed”.

Now, you can use the vSphere Client to log into your vSphere (or ESX) environment and you will see your newly created Virtual Machine, which has already been powered up successfully.

How-To : Running the vSphere 4 Client on Microsoft Windows 7 (RTM/Retail)

Running the VMware vSphere 4 client on a Windows 7 machine just doesn’t seem to work. After the Windows 7 RTM version was released, we could use the vSphere Client to connect to an ESX 3.5 host with no problems. However you still cannot connect to a vSphere 4 host. This lesson describes how to "fix" this issue with a workaround that was presented on the VMware Community Forums (thanks to all on that post!). This is a simple and concise way of implementing the "fix" without having to do a lot of changes to your system (some other blogs have shown the more "difficult" route to accomplish this same thing). What is nice about this method is that it’s easily removable and doesn’t change any system settings permanently.

The Error

media_1256236923217.png

Here I will show the error when connecting our vSphere client to a vSphere 4 server.

media_1256236944803.png

Here is a screenshot of the error. It reads:
Error parsing the server "192.168.70.199" "clients.xml" file. Login will continue, contact your system administrator.
When you click on the "Ok" button, you will get the following error.

media_1256236966000.png

This error reads:
The type initializer for ‘VirtualInfrastructure.Utils.HttpWebRequestProxy’ thew an exception.

The Workaround Fix

We have pre-packaged the files that are needed to "fix" (e.g. workaround) this issue.

Download only ONE of the files below per the version of Windows 7 you are using (e.g either 32bit or 64bit).

http://lewanps.files.wordpress.com/2009/10/viclient4_fix_win7-x32-zip.doc (for 32bit)
http://blog.lewan.com/wp-content/uploads/2009/10/viclient4_fix_win7-x64-zip.doc (for 64bit)

Our blog system won’t allow .zip files so I renamed the files to .doc. Once you download correct file above, RENAME the file to end in a .zip extension and then proceed with the next steps below.

media_1256240056649.png

Once you have renamed the file, right click on the file and select "Extract All".

media_1256240148714.png

Next, extract the files to the location below:
For 32bit, extract to: C:Program FilesVMwareInfrastructure
For 64bit, extract to: C:Program Files (x86)VMwareInfrastructure
In our screenshot, we’re extracting to a 32bit system.
Check the box that says to "Show extracted files when complete".

media_1256240184229.png

You will get a few "Confirm Folder Replace" options. Check the box that says "Do this for all current items" and then click on the "Yes" button to continue.

media_1256240212912.png

Now select the "Do this for the next conflicts" checkmark. Then select the "Copy and Replace" option. We are basically replacing 2 simple configuration files for the vSphere client and for Update Manager. The changes are simple and easy to remove once this issue has been resolved by VMware.

media_1256240246072.png

Next select the checkmark for "Do this for all current items" and then select the "Continue" button. Windows is asking for "admin level" permission to replace the files that we told it to in the previous step.

New Program Links

media_1256240290342.png

After the extraction happens, a box will appear like the one in the screenshot. The two links for the vSphere Client and for the vSphere Update Client are NEW links that will need to be used to launch either program. Feel free to copy these links to your desktop or Start Menu. You MUST use these new links in order for the clients to work.

Connected!

media_1256240816575.png

Launch the vSphere Client using the link described in the previous step. Type in your vSphere Servers’ IP address, your login and password, and viola! you should now connect. Once connected, you can click on the "Inventory" link to see the vSphere server.

media_1256241008122.png

Here is your vSphere server, using the vSphere Client on Windows 7!

How-To: Make ISO’s from the ESX/vSphere Service Console

Since you can mount ISO files as a “CDRom Device” inside VM’s, the common question that normally will come up is, “How do I make ISO files from my existing CD’s?” There are a number of ways to do this however you can use ESX to make the ISO images and then store them either locally on the ESX server or on a SAN attached VMFS. I would recommend putting them on a SAN attached VMFS volume so all of your ESX servers can access them.

Connect via SSH and Make ISO

media_1231184205175.png

The first step is to put the CD in the physical CD reader on the ESX hardware.

Now, SSH into the ESX server (as described under "Connecting via SSH/CLI" in this guide).
Next, type in the following command (also shown in the screenshot):

dd if=/dev/cdrom of=/vmfs/volumes/vmfs_name/filename_for_cd.iso

Replace "vmfs_name" with the actual name of your VMFS datastore.
Replace "filename_for_cd" with the actual name that you want to use for the ISO you are creating.

Browse for ISO

media_1231187598311.png

Now go to that directory where you pointed the “of” (or output file) and you should be able to see your ISO image as shown in the screenshot. Now you can use this ISO file as a CD-ROM device in your Virtual Machine by editing the properties of the virtual machine and pointing the CD to the datastore ISO you created.

How To Collect Data From a Fibre Channel (FC) Switch

Sometimes you will be asked by either the manufacturers support or perhaps by Lewan for data from your Fibre Channel switch. Here is how you can gather that information in a format that helps support and/or Lewan:

Brocade – How-To Collect a “supportshow” from a Brocade Switch from a Windows Host with HyperTerminal
Follow these steps:

  1. Start the HyperTerminal program by selecting Start -> Programs -> Accessories -> Communications -> HyperTerminal.
  2. Make a new connection and select a name and icon for the connection.
  3. A “Connect to” window is displayed.
  4. Change the Connection using modem to TCP/IP (Winsock) and enter the IP address of the Brocade switch.
  5. Click the OK button.
  6. Log in to Brocade switch (default user: admin/default password: password), and then start to capture text. Select Transfer -> Capture text -> File C:supportshow.wri.
  7. Run the Brocade supportshow command.
  8. After the command completes, stop the “capture text” process (Transfer -> Capture text -> Stop).
  9. After completing this for all switches in all related fabrics, type quit and close the HyperTerminal session.

Cisco Support Logs

To capture support logs for a Cisco FC switch, following these instructions:

1) For firmware 1.2(x) and above telnet to the switch and open a capture session.
2) Run the following commands:
    term len 0
    show tech-support details
3) For firmware 1.0(4):  There is not a single command like a supportshow or data collection. There are two ways to get the outputs needed to troubleshoot most Cisco switch issues. Contact Lewan for additional information.

McDATA Switch Data Collection

In order to collect data from a McDATA switch being managed by McDATA’s EFCM utility, follow these instructions:

  1. Select the switch that you want to collect data from.
  2. Select Maintenance and then Data Collection.
  3. Enter a file name to call the file and then select save. Note the directory where the data is saved.  Once you select save, the data collection takes over and the files is downloaded to the local PC and stored in the directory specified.

How to collect switch information and related data from a McDATA DS-16M, DS-32M or another switch with EWS:

These switches (also known as ES3016 and ES3032)  have an Embedded Web Server (EWS) GUI. You can access this through a web browser by entering the IP Address in the URL address line  (that is, http:/10.14.1.92).  Once you have logged in you can run a script that collects switch information including: Network Info, Operating Parameters, Zone Info, Port Login Data, Port Data and Port Types, and Switch Status.

Note:  These model switches do not support serial port connectivity for information retrieval.

To collect this information, follow these steps:

  1. Once you have logged in to the EWS GUI, click on ” Operations ” from the left frame of the EWS GUI.
  2. Click the third tab called “Maintenance.”
  3. Click the secondary tab labeled Product Info.
  4. Click Product Information. This will generate a report.
  5. Click “File” on the web browser toolbar and select “Save As” to save the .txt file with either the default name or one that you rename it to. Save it on the desktop or to a directory where you can locate it so that you can email it to Technical Support.

To locate the switch firmware revision, follow these steps:

  1. Click “View” from the left frame of the EWS GUI.
  2. Select Unit Properties. The last entry of that page has the firmware level.

Lefthand Networks How-To : Reset Storage Module Password

Lefthand Networks storage modules have an admin password which is needed to log into the storage module and to change any settings. In case you forget this password, this How-To explains how to reset the admin password through the console. Thanks to Jason H. in Wyoming for logging a support call and sharing this useful info with us.

Connect a Console to the Storage Module

media-1237820554055.png

For the storage module that you would like to reset the password on, connect a console connection to that module (monitor, keyboard, mouse). You’ll see a screen like this one.

Start the Admin Interface

media-1237820578456.png

Type in: start to start the configuration console interface.

Enable Reset Password Option at Login Screen

media-1237820600147.png

This is the step where you can hold down the SHIFT button and type in LHN
This will give you more options at the login screen as shown in the step below.

Select Reset Password Option

media-1237820711474.png

The “Reset Password” option will now appear under the Login screen which you can select by using the arrow keys to select the Reset Password option and press Enter.

Reset Admin Password

media-1237820748065.png

Type in the new admin login (the default is: admin) and a new password for that login and use the tab key to select the Ok option and press Enter.

Reset Admin Password – Confirmation

media-1237820896644.png

Once you receive a confirmation, the admin password has been reset. You can now use the new login information to login or make edits to the storage module/management group.

How-To: Setup SNMP on ESX 3.5 Servers

To monitor your ESX 3.5 server by using SNMP, we need to enable SNMP on ESX before adding it to your monitoring software. This How-To will show you the steps involved.

 

Log Into ESX Server

media-1235427473105.png

Log into your ESX Server either through SSH or through the console of the server.

Use Nano to Edit Snmpd.conf

media-1235427595706.png

Use Nano (which is a notepad like text editor) to edit the file /etc/snmp/snmpd.conf file by using the command:
nano /etc/snmp/snmpd.conf

Add SNMP Community to Config File

media-1235427774660.png

Use the arrow keys to go down to the section “rocommunity public”. Replace “public” with your community string for your environment (1). Then use “Ctrl+X” to exit out of Nano. You’ll be asked if you would like to save. Type in “y” for yes and hit enter. Press enter again when confirming the filename to save as.

Enable SNMP to Start Automatically After a Reboot

media-1235428097675.png

Since SNMP is not started by default, you’ll need to type in this command to ensure it will be started after a reboot of the ESX server. The command is:
chkconfig snmpd on

Enable SNMP Through the ESX Firewall

media-1235428204838.png

We’ll need to allow SNMP traffic through the built-in ESX firewall. To do this, type in the following command:
esxcfg-firewall -e snmpd

Start the SNMP Service

media-1235428286191.png

Now we’re ready to start the SNMP service. Type in:
service snmpd start

Ready for Monitoring

At this point, SNMP is enabled on your ESX 3.5 server and you can monitor it using your SNMP monitoring software! Happy monitoring!

See Hidden Devices In Windows on Converted VM’s

Whenever performing a P2V (Physical to Virtual) process, you’ll usually have some devices that are left over in the system which are no longer present. It is best practice to remove these devices from the VM so that it is no loading unnecessary drivers for hardware that’s been removed.

To see hidden devices through Device Manager that are no longer present in the system, follow these steps:

Open up a command window and type in:
SET DEVMGR_SHOW_NONPRESENT_DEVICES=1

Then start device manager from the same command window by typing in:
devmgmt.msc

Choose the option “Show Hidden Devices” under the “View” menu.

Go through the different hardware sections and look for greyed out devices (which represents that they are no longer present in the system) and right click on the device and choose “Uninstall”. This will remove the greyed out device permanently.

Happy converting!

VMware – Enable SSH by Root and Connecting via SSH (CLI)

ESX 3.5 has a command line interface called the Service Console, which you can SSH (Secure Shell) into in order to manage ESX or to run commands/scripts. This is how you connect to ESX 3.5 via SSH.

Why Can I Not Login as Root Automatically?

By default, SSH is turned on for ESX 3.x installations however the “root” user is denied from logging into the server as a security precaution. We will need to enable the root user to login by editing a configuration file and restarting the SSH services to take into effect the change.

Login via Console

media-1230596722517.png

On the console of the server, press ALT and F2 buttons to show a login prompt. Log in as root.

Make a Backup of SSH Config File

media-1230596846078.png

First we’ll save a copy of the /etc/ssh/sshd_config file as /etc/ssh/sshd_config.original in case we need a backup. Type in the following:
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.original

Open SSH Config File

media-1230597001567.png

Next we’ll edit /etc/ssh/sshd_config using a notepad-like program called Nano. Type in the following:
nano /etc/ssh/sshd_config
Find the line that says:
PermitRootLogin no

Edit SSH Config File

media-1230597079733.png

Change the line to read:
PermitRootLogin yes

Now save the file and exit by pressing CTRL and X.

Restart SSH Service

media-1230597174611.png

Next, restart the SSH daemon (service) by typing:
service sshd restart

Connecting through SSH via Putty

media-1230597466415.png

To connect via Secure Shell (SSH), you’ll need to use a SSH program, like Putty. Putty is widely known and used since it’s a free open source program. A copy of Putty can be downloaded off the internet by searching Google for “putty ssh download”. Putty is a standalone executable program which does not require installation. I usually copy it to My Documents or a network share and then place a Shortcut on my Desktop or Quick Launch bar. Once downloaded, go ahead and start Putty.
Then type in the IP address of the ESX server into the address location field as shown. You can also type in the IP address and give it a name under ‘Saved Sessions’ and then press “Save”. This will create a session you can easily load by selecting the name and pressing “Load”. This makes it easy so you don’t have to remember IP addresses of your different ESX servers.

Logon to ESX Server

media-1230597639815.png

Once you connect to the server, you’ll need to login as “root”. Type your password (it will not be displayed on the screen). When you login, it will show you the host where root last logged in from and then it will display a command prompt where you can issue commands.