Tome's Land of IT

IT Notes from the Powertoe – Tome Tanasovski

Category Archives: VMWare

Submitted my Scriptomania entry – VM Report Generator

Only 4 days remaining, and I finally settled down to complete the video for my Scriptomania entry.

Here’s the official page to download the script. Looks like it can’t be downloaded until after the judging.  You should see it available on VMWare’s site on March 18th.

I’ve decided to turn the schedule picker function into a more robust and complete module that will have more scheduling options, and give you different methods for scheduling the task i.e. schtasks, wmi, or at….  I think it’s something that would be very useful for myself and the community.

Ok… there’s more I want to type, but I’m very tired.  I will dream of idle connections to vcenter…. zzzzzzz

Scriptomania! 2500 dollar prize!

VMWare is running a scripting contest.  They want the most creative ESXi management scripts possible!  So put on those thinking caps and get scripting!

http://communities.vmware.com/community/vmtn/vsphere/automationtools/scriptomania

Migrating a VM SCSI controller from Bus Logic to LSI Logic

This is an old topic, but it’s something that I get asked all the time from my colleagues who are trying to make heads or tails of the options available for SCSI controllers in virtual machines running on a VMWare ESX server.  For the most part when you create a new vm, and specify the proper guest OS it will provide you with the most suitable controller, but that is not always the case.  When creating a VM from scratch the client will choose the most recent controller that your OS has a driver for on the installation media i.e. Windows 2000 will be installed with a bus logic driver because that driver is on the CD.  The bus logic driver, however, is not the optimal driver for any Windows OS.

The following is the recommended best practice for SCSI controllers:

ESX 3.X – All versions of Windows should use the LSI Logic controller

ESX 4

Windows 2000, XP, 2003 – LSI Logic Parallel

Windows 2008 – LSI Logic SAS

With the latest patch, ESX 4 update 1, you can now use a VMWare Paravirtual controller (PVSCSI) on your boot disk.  If you are using a SAN or iSCSI you will definitely want to explore this option.  The benchmarks being released are showing huge gains.  According to page 6 of the VSphere Performance Enhancements White Paper, “Efficiency gains from PVSCSI can result in additional 2X CPU savings for Fibre Channel (FC), up to 30 percent CPU savings for iSCSI”.  If you are using DAS you will see no benefit.  I currently have a post in the VMWare forum to find out if there are any gains with NFS storage.  I’ll make sure to update this post/site once I have an answer.

In the meantime this post will focus on converting your VMs to the LSILogic controller.  This is not as easy as it should be, but it’s not that difficult once you understand the steps.  The problem is that if you change your primary adapter from one type to another you will blue screen on boot up since the driver is not yet installed.  The below procedure will add a second SCSI adapter of the type you are changing to so that the driver will be installed when you change the primary controller.  Unfortunately, you cannot add the second controller through VCenter so you will need to modify the .vmx file directly.  This can easily be done through vcenter by browsing the datastore to the file and using download and upload to modify the contents.  You can just as easily do this through a shell, but for our purposes I will document it the VCenter way in case you are using ESXi or don’t have credentials to log in to a shell.

  1. Log onto the VM with your credentials or the local administrator.  This is done to ensure that you have a profile available on the system.  Later you will lose network connectivity so you need to make sure you can logon first.
  2. If this is a Windows 2000 server you will also need to upload the lsi logic driver to the system at this time.  You can get this driver on the lsi website.  The driver you are looking for is LSI20320.
  3. Shut down the VM
  4. Browse the data store and folder where the vmx file is located for the VM.
  5. Download the vmx file and make an extra copy of the file somewhere on your system for backup purposes.
  6. Edit the vmx file in word pad or some other text editor besides notepad:
    1. Find the line:
      1. scsi0.present = “true”
    2. Add two lines underneath that one (location doesn’t matter, but it’s easier to find it later if you always use the same place):
      1. scsi1.present = “true”
      2. scsi1.virtualdev = “lsilogic”
    3. Save the .vmx file.
  7. Upload the saved file over the existing one for the VM.
  8. Power on the VM and log on.
  9. If this is Windows 2000 you will be asked to supply the driver.  Otherwise the driver will be installed automatically.
  10. Shut down the VM
  11. Through Vcenter edit the settings of the VM and highlight your SCSI controller that is currently configured for buslogic.
    1. Click Change Type and specify the appropriate LSI logic controller type for the OS (as discussed above).
  12. Power on the VM and log in.
    1. If prompted to change the disks say yes to all prompts.  Sometimes you will not notice this popup, but you will see a message if you look at the summary page of the VM in VCenter.
  13. Shut down the VM again.
  14. Download the vmx file again and remove the two lines you added in step 6-2.  Save, and upload the vmx file.
  15. Power on one final time.

Enable Powershell Remoting While Running VMWare Workstation in a Domain

Ugh…. What a headache.  I attempted to enable Powershell remoting on my workstation this morning in order to test out some deployment scripts I have ideas for.  Unfortunately while doing this I received the below message:

WinRM firewall exception will not work since one of the network connection types on this machine is set to Public. Change the network connection type to either Domain or Private and try again. At line:50 char:33 + Set-WSManQuickConfig <<<< -force + CategoryInfo : InvalidOperation: (:) [Set-WSManQuickConfig], InvalidOperationException + FullyQualifiedErrorId : WsManError,Microsoft.WSMan.Management.SetWSManQuickConfigCommand WinRM firewall exception will not work since one of the network connection types on this machine is set to Public. Change the network connection type to either Domain or Private and try again. At line:50 char:33+ Set-WSManQuickConfig <<<< -force + CategoryInfo : InvalidOperation: (:) [Set-WSManQuickConfig], InvalidOperationException + FullyQualifiedErrorId : WsManError,Microsoft.WSMan.Management.SetWSManQuickConfigCommand

It appears that the VMWare Workstation NICs that get added to your system take on the public network profile.  One would think this would be easy to fix…. load up control panel->network-> and make the switch.  It is that easy unless you are on a domain.  When you are on a domain the option is not available to you.  After some digging I found this article that discusses how to change these settings using a COM object through Powershell, but the script does a check to ensure that the computer is not on the domain before it makes the change.  I decided to go head first and try it out on the non-domain connected NICs, and I found that it worked like a charm.

Here is the script that will change all public profile NICs to become Work Network NICs:

$nlm = [Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]"{DCB00C01-570F-4A9B-8D69-199FDBA5723B}"))
$connections = $nlm.getnetworkconnections()
$connections |foreach {
    if ($_.getnetwork().getcategory() -eq 0)
    {
        $_.getnetwork().setcategory(1)
    }
}

Afterwards I was able to enable remoting with no problem.

%d bloggers like this: