Comparison between Virtual Server and Windows Virtualization, Part I

28. December 2006 06:14 by Jaguilar in General  //  Tags:   //   Comments (0)

Windows Virtualization is the next generation of virtualization solutions offered by Microsoft. Here is a quick list on how it compares to Virtual Server 2005 R2 SP1:

  • Supported Hardware: Virtual Server 2005 R2 SP1 runs on both x86 and x64 architectures. Windows Virtualization will be x64 ONLY.
  • Virtual Machine Support: Virtual Server supports 32–bit virtual machines. Windows Virtualization supports both 32 and 64–bit Virtual Machines
  • Virtual Machine Memory Support: Virtual server can allocate up to 3.6GB per VM. Windows Virtualization will be able to assign up to 32GB per VM
  • Hot add: Virtual Server does not support adding hardware to a virtual machine while it is running. Windows Virtualization supports hot add of memory, processors, storage, and networking devices.

Viridian in Action

28. December 2006 05:51 by Jaguilar in General  //  Tags:   //   Comments (0)

A couple of weeks ago, during the Virtualization for Developers event in Redmond, we had a short presentation on Viridian by Arno Mihm, Program Manager for Windows Virtualization. He explained the features that will be available on that platform, the differences with the current Virtual Server architecture, and also talked a little bit about the hypervisor.

Windows Virtualization is coming up with some pretty impressive features. The Windows Hypervisor is a tiny piece of code (right now it is around 160KB… it has grown, though, since it was 140KB when we first heard about it on the Longhorn Developer Review back in April), that manages the different partitions running on the physical computer. Microsoft has taken an intelligent approach at this level. The hypervisor only manages context switches between the VMs and protects access to the different VM’s resources. All device drivers and any other logic are managed by the parent OS. This way the hypervisor code can remain really small and extremely fast, and provide the type of reliability that is necessary for this type of environment.

Another nice feature of Windows Virtualization is the device driver architecture. “Enlightened” operating systems will route all device requests through Virtualization Service Clients, that through a very efficient communication mechanism (called VMBus) will communicate directly with Virtualization Service Providers on the parent partition of the server, and then call the hardware directly. This is more efficient than current implementations, in which calls to virtual devices are trapped and handled through the virtual machine worker processes, requiring several context switches in the process.

The best part of the presentation, however, was to finally get to see Windows Virtualization in action. He did a short demo on his laptop, that had a preliminary build of Longhorn server with the Hypervisor enabled. One of the virtual machines was also running Longhorn server, and he showed us how you can dynamically add memory to a virtual machine, WHILE THE VM IS RUNNING, and the client operating system (Longhorn server in this case) will pick it up immediately. This is very useful for those times when you need to give an extra boost to a virtual machine so it can complete a certain task. And my understanding is that all new server products from Microsoft (starting with Exchange 2007) will be able to dynamically pick up these changes as well.

Starting with the internationalization bla bla (Part Two)

27. December 2006 10:50 by Mrojas in General  //  Tags:   //   Comments (0)
Ok enough theory. To start using the internationalization stuff lets start with a simple Form.

Open  the Visual Studio IDE. And Start a Windows Forms project. And then create a simple Form. Add some labels and buttons and set their captions. Once you do that and finish the initial creation of the form, go to the properties pane and change the Localizable property to true and assign the desired value in the Language property. The Visual Studio designer will save the changes in additional resource files whose names will look like <FormName>.<culture>.resx

Once you finish the texts, sizes, positions for the first culture and save it. The IDE creates the resource file for that culture. If you want to create a resource file for another language just change the Form property and assign the text for this new language.

 

You can not only assign personalized translations for each region but also the position and size of components. This is useful because in some languages the buttons might need to be bigger because the labels could be bigger.

 

All this work is supported by the .NET resource managers. System.Resources.ResourceManager class.

 

I recommend you also using String Resource Tools like the ones at: http://www.codeplex.com/ResourceRefactoring

 

These tools makes it even easier the task of moving all your strings to resource files:

 

Taking an application to the whole world (Series 1 of 3)

27. December 2006 03:59 by Mrojas in General  //  Tags:   //   Comments (0)

Recently I was asked by some fellows some help to make a new version of their VB6 application in Spanish, but at the end we end up migrating the application to VB.Net and taking advantage of the .NET internationalization features.

 

VB6 did not provided and out-of-box support for multiple cultures, but the .NET framework provides the developer with utilities to create applications that allow users in multiple regions use their applications according to their “Culture”.

 

The .Net Framework is able to handle different cultures. These “cultures” are used to localize certain aspects of the application for particular geographic zones.

When an application is not created with any cultural considerations it is said to use a Neutral Culture. It implies that independent of the machine configuration it will behave and display components in the same way.

 

The Culture is assigned automactically using the machine settings or it can be altered programmatically. You can use the property System.Globalization.CultureInfo.CurrentUICulture for that purpose.

 

Cultures have two elements: language and region. For example for Argentina where Spanish is spoken la culture will be es-AR (es is for Spanish: ESpañol and AR for Argentina)

 

If no information is found at all for an language then the neutral culture is used.

 

The information for user display is handler in assemblies usually called “satellite assemblies” which are loaded depending on the culture of the environment where the application is executed.

 

Running Vista on a Virtual Machine

26. December 2006 11:18 by Jaguilar in General  //  Tags:   //   Comments (0)

Over at the Virtually vista blog there’s a post talking about how to run the RTM of Vista in a virtual machine. Regarding the supported products and additions, the post states:

If you're using Virtual PC, you should be using the VPC 2007 Beta - the additions that ship with that product work just fine in Vista.
If you're using Virtual Server, you should use the VS 2005 R2 SP1 Beta - those additions work with Vista as well.

The only downside we've found with running Vista on a VM is that the precompactor doesn't work - and Vista uses a lot of disk space during the installation, so we haven't been able to compact a dynamic VHD with Vista.You can get both VPC 2007 and Virtual Server 2005 R2 SP1 Beta form http://connect.microsoft.com.

Merry Christmas!!!

22. December 2006 11:28 by Jaguilar in General  //  Tags:   //   Comments (0)

Yep, it’s that time of the year again. I just wanted to write a quick post to wish you all a Merry Christmas and a Happy New Year!!

I’ll probably make a couple of post in the next few days, since I won’t be taking time off for the holidays. But for those of you that do, I hope you have a happy holiday!!

Cheers.

Is .NET hotter that Java

21. December 2006 11:44 by Mrojas in General  //  Tags: ,   //   Comments (0)
This is a very controversial topic. Recently I have seen several blogs that state that the VB6 Programmers are moving to other platforms like PHP or Java instead of VB.NET
For example see:
Number of VB Developerts Declining in US
By Steve Graegert
“They’re also leaving VB.NET; which is down by 26%. This means Java now holds the market penetration lead at 45% (with developers using Java during some portion of their time), followed by C/C++ at 40%, and C# at 32%.”

I also remember an Article I read in 2005 in JDJ (Java Developers Journal) that expressed that C# was a language created similar to C++ to aid the C++ programmers move to the .NET Framework, argument that I do not share.

I have no evidence but I do not feel that it is that way. I'm am a Java Developer too. And both platforms have their merits. C# is a nice language, very similar to Java and C++ no doubt but it deserves its own place. Visual Studio has still a path to follow. But VS2005 provides some useful refactorings and the incredibly awaited feature that allows you to edit the code that you're running :)

Maybe the 1.0 and 1.1 frameworks were not enterprise ready, but 2.0 and 3.0 frameworks are an excellent improvent.

Java as well had to go thru a lot of JDK releases. They have just released the 1.6 and what about the J2EE releases, the Java Enterprise Beans fiasco. You can confirm that by looking at the rise of POJO (Plain Old Java Object) frameworks like spring.

In general everything requires time to grow. I think that Java has been more time in the market and it has finally provided mechanisms that allow the development of enterprise services "easier" and it is giving it momentum.

.NET components industry is common, there are lots of components and somethings are easier. So I'll wait some time, maybe a couple of year to really find out which is the hotter platform.

Virtualization for Developers Event Wrapup

20. December 2006 04:59 by Jaguilar in General  //  Tags:   //   Comments (0)

Last week we succesfully delivered the first in the series of virtualization events aimed at developers creating software to work with Virtual Server 2005. Even though we didn’t get as much of a turnout as we were expecting, the event was a complete success. Also, the feedback we got for both the content and the presentation was excellent!

I encourage you to register for one of these events. The next one is in Zaragoza on Jan 23–25. The next US event will be again in Redmond, on Feb 6–8. Don’t miss them!

The Most Evil Virtual Machine (as of now)

18. December 2006 12:08 by Csaborio in General  //  Tags:   //   Comments (0)
Not everything that revolves around Virtualization is good - point in case: the software known as Microsoft.Windows.Vista.Local.Activation.Server-MelindaGates.

This VMW virtual image fools Microsoft's latest operating system (Vista) into believing that it is contacting a Key Management Service server (KMS).  When Vista tries to access the KMS, it connects to the Virtual Machine and within seconds the operating system is activated and fully functional even though it is a pirated copy.

As of now, Microsoft has yet to release an update that will fix this hack and assist Vista into knowing that it is not contacting a real KMS.  It really makes you wonder how soon the hackers will release and update to their VMWare image after Microsoft releases their update.

The complete article is on on the vmblog's web site.

Rational Refactoring driven by Semantics

18. December 2006 10:18 by CarlosLoria in General  //  Tags:   //   Comments (0)

In this introductory post, we motivate some basic notions and set a context with respect to the problem of performing computer aided refactoring; we want to pay special attention to refactoring of Web pages as a target and look for implementation paths as a systematic process, subject that we present in a white paper available for the interested reader.

Refactoring is understood as any form of software transformation which is performed with the purpose of improving quality attributes of some piece of software without changing its originally intended behavior; it is used typically for accomplishing more readability and better understanding. A refactoring step should be relatively small and specific, so that is easily testable, for instance trough unit-testing; however such steps can be composed for achieving a broader transformation goal. Software refactoring can be effectively used to interleave "actual" development steps with small and disciplined (e.g. preventive and perfective) steps of maintenance; by this way, refactoring makes feasible to reach higher levels of software quality at the long term without necessarily disturbing programming productivity at the short term.


Refactoring  tools are nowadays hosted in many IDEs for popular programming languages for tasks like consistently renaming of an identifier, for performing method extraction and method pull-up/down operations, among some others. The IDE usually gives facilities to apply the transformation in a mechanical and safe way; the user is the driver the IDE is the refactoring vehicle in such a case. In some cases, the refactoring operations are predetermined, so the programmer has no easy way to create and compose his/her owns transformations, for instance defining own made set of rules for naming conventions or criteria for diagnosing aspects of design quality, those eventually deserving refactoring efforts.
 
Beyond the nice possibility of programming refactoring, let us suppose we also are interested in a more automated and flexible form of refactoring, namely, one that assists by the detection of refactoring opportunities and  anticipates the benefits of applying associated transformations.
Although such a facility would be certainly useful, we can easily realize that there can be a lot of opportunities of different nature for identifying a valuable refactoring task. So, if we think of such a process as a search problem, we rapidly need to accept that the search space can be big and heterogeneous with respect to the nature and goals a programmer may attempt to accomplish through the one or the other kind of refactoring path. Those goals may also depend on the kind of software element we are interested in.

With this general context in mind, we consider one specific case, namely the refactoring of web pages; for such purpose we have developed a white paper, where we elaborate on standard reasoning strategies envisioning the requirements for an automated tool which aids at the task of systematically refactoring web pages. Our presentation -that we name rational refactoring- is more intuitive and practical than formal, we focus on the central value of employing a semantically based approach for driving the process and expose justifications in terms of the some potential advantages we may obtain when we are considering computer aided refactoring of web pages, specifically. We use some ASP.NET facilities for illustrations purposes. The white paper is available here.



 

Convert VMWare Virtual Hard Disks to VHD Format

14. December 2006 06:44 by Csaborio in General  //  Tags:   //   Comments (0)
Many people at Artinsoft use VMWare for their Virtualization needs.  This quickly became a hassle as the VMs that they were using that I needed could not be used in Virtual Server.  I just found out through this article that there is a new tool called the VMDK to VHD file converter.

I have not yet tested the tool, but soon I will be converting all the RedHat VMDK to VHDs and running them on our Virtual Server R2 SP1 (which fully supports Linux!). 

You can find the official link here, download it and let me know if you run into any issues!

Should I use a SCSI or IDE controller for my VHDS?

14. December 2006 06:36 by Csaborio in General  //  Tags:   //   Comments (0)
I have talked quite a bit in terms of the different VHDs there are, let's now focus on the different controller types that are available.

When you create a VHD, you need to attach it to an emulated controller in order for the VM to use it.  You have two options: SCSI or IDE, but which one should you choose and why?

The rule of thumb seems to be: if you can use SCSI, use SCSI, but why?  SCSI emulated controllers allow concurrent connections on the BUS, so this will make operations with multiple VHDs faster.  Furthermore, your VHDs can be bigger with SCSI controllers (2 Terabytes SCSI vs. 127 GB IDE!).  If that was not enough, SCSI controllers have more devices that can be attached to them.  IDE supports only 4 connections, SCSI supports up to 28!

Furthermore, emulated devices such as DVD drives can only be attached to IDE buses, so you better save those buses for these types of connections.  

So when should you use IDE controllers?  Use them when working with removable media or when you are dealing with a VHD that has an OS that will not allow itself to install itself on a SCSI connection.

Taking Advantage of Virtual Machines - IE 6 Testing VPC Image

2. December 2006 21:15 by Jaguilar in General  //  Tags:   //   Comments (0)

Microsoft released Internet Explorer 7 a few months ago, with some great features such as an RSS reader and tabs (my favorite). You, however, cannot run both Internet Explorer 6 AND Internet Explorer 7 on the same Windows installation. So if you are a web developer, and have to test your web pages in different versions of the browser, what can you do? Well, for one, you can thank Microsoft for releasing Virtual PC 2004 as a free download.

One of the known advantages of virtualization is the fact that you can run different configurations on the same machine. Microsoft is right now using this to help developers, by releasing AS A FREE DOWNLOAD a Virtual Machine image that contains a pre-activated Windows XP SP2 installation, Internet Explorer 6 and the IE7 Readiness Toolkit. With this VPC Image, you can run IE7 as the standard browser in your PC, and have and Virtual PC 2004 image with IE6 for testing purposes.

You can get more information about the VPC image in this post at the IEBlog. One of the downsides of the image, though, is that it has a "timebomb" and expires in April, 2007. But, between now and then, looks like the best alternative for running both browsers on your PC.

You can get the image from the Internet Explorer 6 Testing VPC Image download page

Tidbits on VHDs - Part 2

1. December 2006 11:24 by Csaborio in General  //  Tags:   //   Comments (0)

On my previous article, I touched base with the types of VHDs that are available.  I will now try and pinpoint which are the best scenarios to use each of those VHDs.

Fixed disks are the ones that offer the best performance because there is no dynamic creation since the VHD is always the size that was specifed in its creation.  The chance of fragmentation is also less when working with Fixed VHDs.  If your application is disk intensive and you are planning on running it on a VM, then this type of disk is the best way to go.

Dynamic disks work best when you want to make the best use of your space and you can withstand the performance penalty and fragmentation chance that can happen.  If you want to save the most space when running VHDs, then dynamic disks are your best option.  Use caution when working with dynamic disks as if the disk is expanding and the server runs out of space, disk corruption may occur.

Differencing Disks are a blessing for the IT Pro.  If I was an IT admin, I would just have base VHDs of the most frequently used OS in my enterprise.  For instance, I would have various VHDs with Windows Server 2003 Enterprise, Windows XP, Windows Vista and so on.  When someone requested a Windows XP disk with Visual Stuido installed, I would just create a differencing disk and install Visual Studio.  You can also have differencing disks of differencing disks which can become more and more useful in the long run.  The main thing to watch out for is to make sure that the parent is always read only, since any modification will render the “son” VHDs in an unusable state.

Finally, if you are looking for a way to convert a physical disk that does not contain an OS, you can just link the physical disk to a virtual one by setting up a Linked VHD.  Once you do that, all it takes is a trip to the Virtual Server Administrative interface and convert the linked disk to a fixed or dynamic one.  If you want to convert a physical disk that has an OS installed, you must use the Virtual Server Migration Toolkit.  Tips on how to use this tool belong in a future blog entry.  Take care!

Tidbits on VHDs - Part 1

1. December 2006 11:12 by Csaborio in General  //  Tags:   //   Comments (0)

Virtual Server has various VHD (Virtual Hard Disks) available for creation, namely:

  • Fixed
  • Dynamic
  • Differencing
  • Linked

In this first part of this blog, I will try and explain how each VHD works. 

Fixed VHDs are the closest thing that resemble a real hard drive.  When you create them and specify its size to 20 GB for example, the actual VHD file will be indeed 20 GB in size.  This means that if you are only using 1 GB of the VHD, it will still be taking 19 GB of space on the server where the VHD is stored.

Dynamic Disks, on the other hand, are not the size you specify at upon creation.  If you specify a dynamic VHD of size 20 GB, it will be originally created as a small drive, and as you write information and need more space, the VHD “dynamically” expands in size.  This operation can have a small toll on the VHD’s performance when it is expanded.  Furthermore, there can be more fragmentation issues since a sequence of bytes can be scattered in different places in the physical drive. 

Differencing Disks have a parent VHD.  Only the difference between the parent and the son will be written to the differencing VHD.  This means that if you need to create 20 Windows XP machines, instead of creating 20 VHDs with Windows XP (something that could take 40 GB), what you can do is set a Windows XP VHD as the parent (2 GB) and set the 20 VHDs as differencing (around 200 MB per disk).  You will be saving a lot of space this way.

Linked VHDs are pointers to real physical disks or partitions.  They are not meant to be used with virtual machines when they are on.  The only reason why you would want to use a linked disk is so that you can carry out a P2V (physical to virtual) migration. 

In my next blog, I will talk about which VHDs work best for which scenarios.

Invoke a WebService that needs Windows Authentication

1. December 2006 10:22 by Mrojas in General  //  Tags:   //   Comments (0)

Passing client credentials to a Web service using Windows authentication

Sometimes a Web Service is under a configuration that requires Windows Authentication. It is not a problem for .NET, all you need to do is set your environment to send the client credentials.
  1. First Create a Reference to a Web Service:





To do that just go to the references of your project and add a Web Reference. Type the URL of your web service. This will find your Web Service Reference and you can update it. This will generate the proxy code you need to access your webservice.

If you try to call your webservice with a call like:

WebReference.MyService pService = new WebReference.MyService ();
pService.doStuff("A", "B");

You’ll get a HTTP 404 forbidden access exception.

Now to send the user and password to call your service write some code like the following:

WebReference.MyService pService = new WebReference.MyService ();
pService.Credentials = new System.Net.NetworkCredential("user", "password");
pService.doStuff("A", "B");

You can also send the domain name as part of the parameter to the NetworkCredential class:

pService.Credentials = new System.Net.NetworkCredential("user", "password","domain");

It will be even better to have your user and password not in your code but in the configuration file for your program. You can then use the AppSettings class to access those properties.

ToolTip with Images

1. December 2006 06:30 by Mrojas in General  //  Tags:   //   Comments (0)

The Tooltips that comes out of the box for winforms do not support images on them. This is a simple class that allows you to add Images and Text to your ToolTips

using System;

using System.Windows.Forms;

using System.Collections.Generic;

using System.Text;

using System.Drawing;

namespace CustomControls

{

class ToolTipWithImage : Control

{

private Image _img;

private Control _ctl;

private Timer _timer;

string _imgfilename;

string _tiptext;

public String TipText

{

get { return _tiptext; }

set { _tiptext = value; }

}

public String ImageFile

{

get

{

return _imgfilename;

}

set

{

if (_imgfilename == value)

{

}

else

{

_imgfilename = value;

try

{

_img = Image.FromFile(_imgfilename);

this.Size = new Size(_img.Width + 70, _img.Height);

}

catch

{

_img = null;

}

}

}

}

public ToolTipWithImage()

{

this.Location = new Point(0, 0);

this.Visible = false;

_timer = new Timer();

_timer.Interval = 1000;

_timer.Tick += new EventHandler(ShowTipOff);

}

public void SetToolTip(Control ctl)

{

_ctl = ctl;

ctl.Parent.Controls.Add(this);

ctl.Parent.Controls.SetChildIndex(this, 0);

ctl.MouseMove += new MouseEventHandler(ShowTipOn);

}

protected override void OnPaint(PaintEventArgs e)

{

if (_img != null)

{

e.Graphics.DrawImage(_img, 0, 0);

e.Graphics.DrawString(TipText, this.Font, Brushes.Black, _img.Width, 0);

}

}

public void ShowTipOn(object sender, MouseEventArgs e)

{

if (!this.Visible)

{

_timer.Start();

this.Left = _ctl.Left + e.X + 100;

this.Top = _ctl.Top + e.Y;

this.Visible = true;

}

}

public void ShowTipOff(Object sender, EventArgs e)

{

_timer.Stop();

this.Visible = false;

}

}

 

}

 

To use it just do something like

ToolTipWithImage timg = new ToolTipWithImage();

timg.TipText = "Hello";

timg.ImageFile = @"C:\Hello.gif";

timg.SetToolTip(btnOk);

Virtual Server 2005 Performance Tips

30. November 2006 12:23 by Jaguilar in General  //  Tags:   //   Comments (0)

I found two websites that give tips on how to get the best performance out of Virtual Server 2005. Check them out:

One of the best tips came from the second article, when discussing SCSI and IDE virtual hard disks:

Still, the rule for performance is pretty simple. Use SCSI-attached VHDs whenever you can and use IDE-attached VHDs whenever you must.

 Both pages give excellent tips, and discuss things like the amount of memory you should have, how to optimize VHD placement, number of CPUs, and others. I recommend you look at them if you are considering installing Virtual Server.

Virtualization for Developers event in Redmond in two weeks

30. November 2006 06:47 by Jaguilar in General  //  Tags:   //   Comments (0)

The first Virtualization for Developers event will be held in Redmond between December 12–14. The registration is still open at the Virtualization Developer Lab Series webpage. We’ve been working hard on the content for this labs, and we are really looking forward to this event.

In these events you will learn how to work with the Virtual Server 2005 COM API in great detail. Once you complete them, you’ll be able to script common management tasks, and incorporate API calls to your own management applications. You’ll also get an overview of Virtual Server capabilities, and you’ll see how the System Center Virtual Machine Manager can make your life easier. You can review the complete agenda on this webpage: Virtualization 3 day Lab Agenda Overview.

Key Stakeholders: Developers

28. November 2006 09:14 by jpena in General  //  Tags:   //   Comments (0)

The developers of a legacy application tend to have an important sense of ownership of the application: probably they’ve spent many months in its design, coding, stabilization and maintenance tasks.  Also, they’ve got a lot to say about the future enhancements that should be made to the application, especially taking advantage of the features of the target platform after a migration is done.

In addition to this sense of “fatherhood” over the source code, developers have the best knowledge of the nuts and bolts of the application.  Naturally, no one knows the code more than the ones who actually wrote it.  Because of this, developers are among the key stakeholders that you must take into account when managing a migration project.

You may find the following tips useful when working with developers as a stakeholder group in migration projects:

  • Most developers will feel very enthusiastic about the migration project.  If they are part of the team that executes the migration, they will help keep the team motivated.  If they are not in the team, it’s always a good idea to keep them informed of the technical details of the project.
  • Some developers, especially if they are part of the team in charge of the migration, will feel tempted to do some enhancements to the application during the migration project.  This may introduce some sort of “feature creep” to the project, possibly increasing the testing and stabilization costs.  I guess you don’t want this, so make sure everybody stays focused on the goal of achieving Functional Equivalence first!
  • Developers who are not skillful yet on the target platform will feel rightfully concerned about the migration project.  Of course, they need training!  Make sure they receive proper training on the target language and technologies before the migration project finishes and they have to continue their maintenance tasks in the new platform.

Categories