ArtinSoft's Blogs

Software Migration Experts
Welcome to ArtinSoft's Blogs Sign in | Join | Help
in Search

Jose Aguilar's Blog

All things migrations, software and technology

August 2006 - Posts

  • Virtual Server 2005 R2 SP1 BETA2 is out

    You can now download Virtual Server 2005 R2 SP1 BETA2 from http://connect.microsoft.com. As with other beta software, you need to register for the beta first.

    This release is pretty significant because it is the first version to support both AMD-V and Intel-VT hardware virtualization. From the release notes, it includes:

    • AMD Virtualization (AMD-V) compatibility
    • Intel Virtualization Technology (IVT) compatibility
    • Volume Shadow Copy Service support
    • Offline VHD mounting
    • Active Directory integration using service connection points
    • Host Clustering technical white paper

    The best part is that you can upgrade existing installations very easily:

    VSUPGRADE

    I just upgraded my 32–bit workstation, and everything is working like a charm.

  • Documentation on Best practices for Virtual Server

    When you make a Virtual Server deployment, make sure that you follow Microsoft’s recommended Best practices for Virtual Server. They can improve the performance of Virtual Server installations, and make your life as a system administrator easier.

    One important thing that many people overlook when creating multiple VMs is the importance of using Sysprep. I wrote a quick walkthrough here, and you can find documentation on Microsoft’s website about it as well. Sysprep makes sure that each cloned virtual machine will be unique – not using it may introduce security and performance issues in your network.

  • Reading Virtual Server's performance counters from .NET

    This code allows you to retrieve the information for Virtual Server’s performance counters from C#. It reads both the Virtual Machines and Virtual Processors counters.

     

       1:  PerformanceCounterCategory vmCat =
    new PerformanceCounterCategory("Virtual Machines");
       2:              PerformanceCounterCategory vpCat = 
    new PerformanceCounterCategory("Virtual Processors");
       3:  string[] vmInstances = vmCat.GetInstanceNames();
       4:  string[] vpInstances = vpCat.GetInstanceNames();
       5:   
       6:  List<PerformanceCounter> countersList = 
    new List<PerformanceCounter>();
       7:  
       8:  foreach (string instance in vmInstances){
       9:  PerformanceCounter[] counters =
    vmCat.GetCounters(instance);
      10:  foreach (PerformanceCounter pc in counters)
      11:  {
      12:              countersList.Add(pc);
      13:  }
      14:  
      15:  foreach (string instance in vpInstances)
      16:  {
      17:              PerformanceCounter[] counters =
    vpCat.GetCounters(instance);
      18:              foreach (PerformanceCounter pc in counters)
      19:              {
      20:                          countersList.Add(pc);
      21:              }
      22:  }
      23:   
      24:  while (true)
      25:  {
      26:              System.Threading.Thread.Sleep(1000);
      27:              foreach (PerformanceCounter pc in countersList)
      28:              {
      29:                          Console.WriteLine(
                                      "{0}:\"{1}\" Counter:{2} Value:{3}",
                                      pc.CategoryName, pc.InstanceName,
                                      pc.CounterName, pc.NextValue());
      30:              }
      31:  }
  • Paravirtualization and Xen

    Another virtual machine product that has been making a lot of noise lately is Xen, the open source project from Xensource. Xen uses a different  approach to virtualization than Virtual Server, called Paravirtualization. In this type of virtualization, the guest OS has to be modified to work with a software interface to the Virtual Machine Monitor, instead of thinking it is running on the hardware. The thing is that this actually enables better performance of the Guest OS, as it aware that is running on a virtual machine environment. Xen also supports running unmodified OSes, but for that it is mandatory to have hardware virtualization (VT-x on Intel or SVM on AMD CPUs).

    The next releases of Windows Virtualization are implementing a similar approach. It will still be pure virtualization, but the Guest OS will also be enlightened. What this means is that the Guest OS will be aware that it is running on a VM, so it will be able to increase the performance using a modified kernel. The best part about all this is that Microsoft and Xensource are actually working together to make sure that the technology included with Windows Virtualization will be compatible with the technology used in Xen. So, at the end, we, the customers, win.

  • Live Writer sample post

    The Windows Live team recently launched the Live Writer tool for writing blog posts. This is a sample post made with the tool. So far, it looks nice, with most features already working.

    One of the nicest features is Live Map integration:


    San Jose, Costa Rica

    I think I am going to stick with Blogjet for the time being (especially for the flickr integration). But it won't harm you to check out Live Writer as well.

    Posted Aug 15 2006, 07:44 PM by Jaguilar with no comments
    Filed under: ,
  • Virtual Server, WMI and C#

    This code snippet allows you to connect to a remote instance of Virtual Server 2005 R2, via WMI, and retrieve all the Virtual Machine WMI objects.

       1:   
       2:  System.Management.ConnectionOptions co = 
       3:      new System.Management.ConnectionOptions();
       4:  co.Username = user;
       5:  co.Password = password;
       6:   
       7:  ManagementScope scope = new ManagementScope(
       8:      new ManagementPath(@"\\"+computer+
                @"\root\vm\virtualserver"),co);
       9:   
      10:  scope.Connect();
      11:  SelectQuery oq = 
      12:      new SelectQuery("SELECT * FROM VirtualMachine");
      13:   
      14:  ManagementObjectSearcher searcher =
      15:      new ManagementObjectSearcher(scope, oq);
      16:   
      17:  foreach (ManagementObject queryObj in searcher.Get())
      18:  {
      19:       //Do something
      20:  }
     

    You need to provide a user and password with enough credentials to query the Virtual Server instance.
    BTW, if you ever need to format your code for display on the web, check out this website.

  • HP and Intel Developer Workshops - Boston

    There’s a new HP and Intel Developer Workshops coming up in a couple of weeks. This one is going to be in Peabody, MA (close to Boston), between August 22–24. We will be teaching some of the lectures in the 64–bit Windows track.

    These workshops provide a great opportunity for you to get hands-on experience on Itanium machines. We will also have open lab time so you can start porting your application to the architecture – and remember that we are going to be around to help you with your efforts.

    Posted Aug 09 2006, 07:14 AM by Jaguilar with no comments
    Filed under:
  • Tool for creating MSDN-style documentation from .NET code

    One nice features of the JLCA is that it converts javadoc-style comments into the corresponding .NET XML comment. Well, a new tool was released a few weeks ago that can take .NET’s XML documentation and create nice looking files. It is called Sandcastle, and is currently a CTP download. It can create .html files from the source code, which can be processed with the HTML Help Workshop to generate a .chm file. It also has a Visual Studio Add-in that makes the process really easy.

    You can download the CTP here, and read all about it in the Sandcastle team blog.

    Posted Aug 08 2006, 02:47 AM by Jaguilar with 1 comment(s)
    Filed under: ,
  • Yes!! Virtual Machine Manager (aka Carmine) available for download

    Carmine” (System Center Virtual Machine Manager (SCVMM) Beta 1) is available for download! You first need to register for the beta at http://connect.microsoft.com, and then login into http://connect.microsoft.com/vmm/downloads with your passport Id.

    I just finished downloading it and will start playing with it soon. Too bad that calling into VMM from Powershell and the functionality to convert from a physical machine to a virtual machine are not included in this beta.

  • .NET and the Virtual Server 2005 COM API

    Accessing Virtual Server’s COM objects from .NET is not as direct as just including the references to the COM classes. In order to instantiate to the Virtual Server object, you need to have the proper COM permissions. For Virtual Server, the required impersonation level must be Impersonation or higher.

    There are two ways to achieve this:

    1. The first one is to use Component Services to change the Default Impersonation Level to Impersonate. To do this in the Component Service console, go to Computers->My Computer->Properties, and the setting is in the Default Properties tab. This has obvious security implications, though.
    2. The second method is to do it programatically. This can be a bit painful if you’re not familiar with COM and COM Security. You have basically two options:
      • Use the method described in the Virtual Server Programming Guide, that you can find here: .
      • You can also use an alternative method, described by Virtual PC Guy in his blog as a solution to connect to Virtual Server from Powershell. You can check the link to review the code, which consists in using the CoSetProxyBlanket function, that according to the documentation “Sets the authentication information that will be used to make calls on the specified proxy.” Implementing a class similar to the one described on the linked page should work and is much simpler than the recommended approach descrbied in the Programming Guide.
  • Virtual Server Script Center repository

    Scripting allows you to automate common tasks very easily, even if you’re not an experienced developer. One of the best resources for scripters in the Windows world is definitely MSDN Technet’s Script Center. If you’re looking for common scripts, chances are you’ll find one there, or one that you can quickly modify to suit your needs. There’s a large selection of scripts that have to do with Virtual Server – from automatically installing Virtual Machine additions, to modifying the properties of a Virtual Machine. You can check out the complete list here: Virtual Machine and Virtual Server Properties

  • Running scripts on a remote Virtual Server installation

    If you need to connect to a Virtual Server 2005 installation to execute remote scripts, because of security, you can do one of two things. The first one is to use the “ConnectServer” method in your scripts, in order to provide the necessary credentials to connect to the server. To do this, you should have these lines on your script:

    Set objWbemLocator = CreateObject("WbemScripting.SWbemLocator")
    Set objWMIService = objwbemLocator.ConnectServer(<Computer>, "\\root\vm\virtualserver", <user>, <password>)

    Then you can use the normal methods to query the information from Virtual Server

    The second one is to configure the Virtual Server DCOM object so that it allows a remote connection. This has obvious security risks, but can be configured so that only certain groups have the necessary priviledges to execute the code. To do this, you first need to open the Component Services console, and navigate to the node Console Root->Component Services->Computer->My Computer->DCOM Config. There, you need to locate the Virtual Server node, and select properties from the context menu:

    DCOM1

    On the properties page, go to the Security tab, and you need to customize the permission on the Launch and Activation Permissions box by clicking Edit…:

    DCOM2

    On that page, you can add groups or users that will be able to launch or activate Virtual Server’s COM objects, as well as fine-tune what each user will be able to do:

    DCOM3

    This second approach works better with servers that are in an Active Directory domain. On a stand-alone machine, the remote host may have issues providing the credentials to obtain the remote activation and launch permissions required.

Powered by Community Server (Non-Commercial Edition), by Telligent Systems