Showing posts with label SP1. Show all posts
Showing posts with label SP1. Show all posts

Thursday, March 10, 2011

Webcast - Dynamic Memory in Windows Server 2008 R2 SP1 (Hyper-V)

Microsoft Norway published a webcast I created this month.
You can find it here (it`s in Norwegian)

I talk basically about the benefits and values it brings to the virtual datacenter, how to get started, and explains the various settings.

Tuesday, March 1, 2011

Considerations using Hyper-V with Dynamic Memory in Failover Clustering

Ok, so you have had your VM`s running for a while with the dynamic memory feature enabled.
Everything works great, and you plan to put one of your nodes in maintenance mode since there are some important and recommended new available Windows Updates to install.
To place your node in maintenance mode, you need to migrate (Quick Migration or/and Live Migration) your VMs to a node which has available resources.
You are familiar that with SP1 and Dynamic Memory, the only considerations when it comes to capacity planning as far as RAM concern, is the ‘startup RAM’ on each VM.
If a VM is using 20GB RAM, and the destination node has less available, how would this affect the various migrations?



Since the VM now have a certain amount of memory assigned, it would not easily let go of it.
It also depends on the workloads running within the VM, and how much memory the VM actually demand from the parent.

Workaround:

1.       Try to decrease the memory buffer on the VMs running on the destination node
2.       Try to decrease the memory buffer on the VM that is using much memory
3.       Try to decrease the priority on the VM that is using much memory, and decrease the VMs running on the destination node
4.       Are there any possibilities to decrease the memory within the VM? If your VM is running SQL server, you could try to decrease the maximum server memory
5.       If none of the above helps, you may need to power off some of the running VMs to allow the migration (if the node is running some non –critical workloads and you can live with service interruption), or in worst case – power off the VM you intend to migrate, and let it start up on the destination node with the defined startup RAM.


Here is some guidance`s for how you should plan for Dynamic Memory:

1.       Do not configure too high value for the startup RAM setting on your VMs. The whole idea with Dynamic Memory, is that the VM should communicate with the parent (VSP/VMBus/VSC) to determine the memory need. Remember that the value specified on startup RAM is allocated from the host when the VM is powered on, and cant decrease below this value. The Dynamic Memory algorithm will always strive to make this minimum amount of memory available to the VM.
2.       If your VMs are running some heavy workloads (SQL server etc) then there is a good chance that the VM is using too much memory from the host. It`s always important to know your workload, also when you`re using Dynamic Memory. You might find it valuable to specify the maximum RAM setting on these VMs.
3.       Do not increase the memory buffer if it`s not necessary. If your VM is using 20GB RAM, and the memory buffer is configured with 50%, you are actually telling the parent that it should try to allocate an additional of 10GB RAM to this VM, and it may affect the other VMs.
4.       Documentation – it`s important to have an updated documentation, as well as to monitor your VMs after enabling Dynamic Memory.
It can be a lot more complex than this, especially if you`re using preferred nodes, and other ratings. As a best practice, try to document every setting on the VMs – including vNICs, numbers of vCPU, startup RAM/maximum RAM, vhd`s. You may need to restore a VM from time to time, and I have found these documentations very helpful.

Cheers,

Tuesday, February 22, 2011

SQL Servers and Hyper-V with Dynamic Memory

It`s official now - Microsoft SQL Server support Dynamic Memory: http://support.microsoft.com/kb/956893

Before we start to look at this from the Hyper-V perspective, let’s refresh our knowledge on SQL server and memory management.
It`s probably the biggest topic when it comes to SQL server, and you are facing it one way or another on every SQL server. I will not cover every detail here.

First of all: SQL server manages its memory resources almost completely dynamically.
The SQL server communicates constantly with the OS – to allocate enough memory.
(This one is very similar to the VSP/VMBus/VSC – communication between the enlightened VM and the Hyper-V host)

The main memory component in SQL server is the buffer pool. The memory that are not used by another memory component remains in this buffer pool to be used as a so called data cache for the pages read in from the database files on disk.  One of the things that buffer manager manages, is disk I/O functions for bringing data and index pages into the data cache so data can be shared among users.
All data manipulation within SQL server occurs in memory within a set of buffers. If you are adding new data to a database, the new data is first written to a memory buffer, then written to the transaction log, and finally persisted to a data file via a background process called check pointing.
What happens when you modify or delete an existing row, is that if the row does not already exist in memory,, SQL server first reads the data off disk before making the modification. Similarly if you are reading data that has not been loaded into a memory buffer, SQL server must read it out of the data files on disk.

Memory is the most important thing when it comes to SQL servers, besides I/O.
In an ideal world - you could ensure that the machine hosting your databases had enough memory to hold all the data within your databases, SQL server could simply read all the data off disk into memory buffers when the SQL server instance started up – and give you a performance boost.
But sometimes the ideal is not always possible (I love that line) and the databases is most likely larger than memory capacity on any machine, so that SQL server retrieves data from disk only on an as-needed basis.
This brings us over to the data file design. Since accessing a disk drive is much slower than accessing memory, the design itself can have an impact on performance.

What about the Minimum server memory and the Maximum server memory in SQL Enterprise/Datacenter?

The Minimum server memory specifies that SQL server should start with at least the minimum amount of allocated memory and not release memory below this value.
The important thing here, is to set the option to a reasonable value to ensure that the OS does not request too much memory from SQL server.

The Maximum server memory specifies the maximum amount that SQL server can allocate when it starts and while it runs. If you run other applications at the same time as SQL server and want to guarantee that these applications have sufficient memory to run, this option can be set to specify the value.

So how should you configure the Dynamic Memory setting on a VM that is running SQL server?
Remember that SQL is very memory intensive, and uses memory extensively. You do not want your SQL server to use more I/O than necessary. This is very important when you have your VMs located on a SAN, where the throughput also is important. Again, it points us to the usual ‘it depends’ statement.
Personally, I would start to monitor the VM running SQL server after enabling Dynamic Memory.
If you have a lack of physical RAM installed on your host, you should at least configure the host to reserve some amount of RAM before the SQL server consumes it all.
One important thing to notice is the Memory Buffer. Since SQL server consumes memory in a large scale, you may want to adjust this setting – to a lower percentage. Dynamic Memory determines the amount of memory needed by a VM by calculating something called memory pressure. To perform this calculation, Hyper-V looks at the total committed memory of the guest operating system running in the VM and then calculates pressure as the ratio of how much memory the VM wants to how much it has. The amount of memory that Hyper-V then assigns to the VM equals total committed memory PLUS some additional memory to be used as a buffer. So if you have a buffer configured with 50% and a VM that needs 20GB RAM, Hyper-V can make up to 10GB of additional memory available to the VM for use by the file system cache.  But, Dynamic Memory does not guarantee that the additional memory amount configured as a buffer value is always assigned to the virtual memory. All this depends upon the memory pressure being exerted upon the host by the memory needs of the other VMs running.

But generally speaking, the Dynamic Memory feature is fully supported by supported guest OS running SQL server, and it works pretty well.
If you have configured the memory settings within SQL server, this will limit the RAM usage of the VM – if it`s only running SQL servers. When you know your workloads, you also know which VM you should prioritize.

SQL server may be one solid candidate.

Cheers,

Thursday, February 17, 2011

FAQ - Dynamic Memory and RemoteFX (Windows Server 2008 R2 SP1)

Updated March 5.
Updated February 26.
Updated February 22.
Updated February 20.

I`ve spent some time in the Hyper-V forum at TechNet and want to present some of the most common questions about the new features in service pack 1 – which includes Dynamic Memory and RemoteFX.

Q: I have installed SP1, but I can`t see any information about dynamic memory when I create a new VM?
A: When you`re using the wizard to create a VM, you would not be presented with any option for dynamic memory. You will find the dynamic memory option when you open the VM`s settings in Hyper-V Manager afterwards
Q: I have installed SP1 on my Hyper-V host, but I can`t manage dynamic memory from my client?
A: To be able to manage your Hyper-V host with the new dynamic memory feature from your clients, you also need to upgrade your clients with SP1 (Win7 or/and Windows Server 2008 R2)
Q: I`ve installed SP1 and configured the VMs with dynamic memory. However, they does not seem to be functioning with this new feature?
A: After you have installed SP1 on the Hyper-V host, remember to upgrade the IC in the VMs. SP1 brings an updated version of the Integrations Services, that the VMs need to be aware of.
In addition: make sure your guest OS supports this feature.
Q: When will SP1 be available?
A: February 16 on MSDN. February 22 through Windows Update.
Q: When will SCVMM support SP1?
A: SCVMM will not support SP1 until it releases its SP1 update. The official MSFT word on the release of the SCVMM 2008 R2 SP1 update is 60 days after the general availability of the Windows Server 2008 R2 SP1 release
Q: Will SP1 also work on Microsoft Hyper-V 2008 R2 server?
A: Yes, Windows Server 2008 R2 and Hyper-V 2008 R2 use the same service pack – so it will work.
Q: I want to use RemoteFX – but how?
A: To use RemoteFX, the Hyper-V server must be running Windows Server 2008 R2 SP1, the VMs must be running Windows 7 Enterprise with SP1 or Windows 7 Ultimate with SP1, and the remote client computer must be running either Windows Server 2008 R2 with SP1 or Windows 7 with SP1
Q: Are there any HW requirements for RemoteFX?
A: The processor must support SLAT (Second-Layer Address Translation), The graphics card`s GPU must support DirectX 9.0c and DirectX 10. If multiple GPUs, they must be the same card. The cluster requirements would include that the source and the target nodes have identical GPUs.
Q: What changes do I need to do with my cluster after installing SP1?
A: Remember to upgrade every node in the cluster with SP1
Q: Can a VM with upgraded IC be used on another Hyper-V host afterwards?
A: Once a VM has been configured to use dynamic memory by installing the latest Integration Components on the guest operating system, the VM will no longer work on pre-SP1 hosts and cannot be moved to such host.
Q: Are there any cluster-benefits with SP1?
A: As far as RAM concern, you only need to calculate the amount of physical memory available in the cluster when a node has failed and ensure that the sum value of all startup RAM values for all VMs on the cluster does not exceed your calculated value.
Q: If I already have installed the RC of SP1, do I need to uninstall it before installing the RTM of SP1?
A: Yes. There is no in place upgrade from RC to RTM
Q: How does actually dynamic memory works?
A: Hyper-V host and the enlightened VM communicate through the VMBus (the server use Virtual Service Provider and the client use Virtual Service Consumer) to determine the current memory needs of the VM. If the workload of the VM increases and need more memory – then memory is dynamically added to the VM. If the workload decreases (or other VMs have higher memory priority)– the memory is dynamically removed from the VM.
Q: When will the Dynamic Memory Priority kick in?
A: When all available physical memory has been allocated to VMs on the host, the dynamic memory priority starts to play. It will cause the memory to shrink on VMs with no – or lower priority, and allocate more memory to the VMs with higher priority.
Q: And what about the memory buffer?
A: Think of this as a memory reserve for the VM. If you configure a buffer of 50% means that an additional memory of up to 50% of committed memory can be allocated to the VM. The guest OS running in the VM usually use the additional memory for system file cache and performance of the OS and applications.
Q: Can I use Dynamic Memory on both x86 and x64 architectures?
A: Yes, it`s supported for both. (Windows Server 2003/2003 R2/2008/2008 R2)
Q: What happens with guest OS that does not support Dynamic Memory?
A: If you ‘enable’ dynamic memory on a VM which has a guest OS that does not support dynamic memory, it will only use the value defined in the startup RAM.
Q: After I have upgraded the IC within the guest, do I need to reboot before enabling Dynamic Memory?
A: Yes, but you could rather power off the VM after upgrading the IC, configure dynamic memory, and then boot the VM again.
Q: Can I use Dynamic Memory on VMs that is running SQL server or/and Exchange server?
A: You can use Dynamic Memory on every VM as long as the guest OS supports this feature.
When it comes to SQL and Exchange – that are using memory extensively, you may consider defining the maximum RAM value for those VMs. In addition, remember that you can set a similar option on the SQL server – better known as ‘minimum RAM’, and ‘maximum RAM’. This will also affect dynamic memory on the VM. SQL Server announced full support for Dynamic Memory and recommend to set Memory Buffer = 5% for SQL workloads. http://support.microsoft.com/kb/956893
Q: How can I reserve some memory for the parent partition (Hyper-V host)
A: A new registry key is available after you install SP1 on the Hyper-V host
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Virtualization
REG_DWORD value
Name = MemoryReserve
Setting= amount of MB to reserve for the parent partition (minimum 2GB is recommended)
You have to reboot your host to let the changes take effect.
Q: My VMs are currently using only 400MB of RAM, and the setup I intend to run, requires that there is at least 2GB RAM installed. Do I need to power off my VM and assign a higher value of startup RAM?
A: You could assign a higher value of startup RAM, increase the memory buffer, or simply launch mspaint and alter the pixels. It would force the VM to allocate more memory if available on host. How to: http://kristiannese.blogspot.com/2011/02/windows-server-2008-r2-and-windows-7.html
Q: What is the recommended startup RAM for the supported guest operating system with Dynamic Memory enabled?
A: Windows Server 2008 R2 Enterprise/Datacenter, Win7 Ultimate/Enterprise, Windows Server 2008 Enterprise/Datacenter, and Windows Vista Ultimate/Enterprise are recommended to have a startup RAM of 512MB, Windows Server 2003 R2 Enterprise/Datacenter and Windows Server 2003 Enterprise/Datacenter are recommended to have a startup RAM of 128MB
Q: Currently have Windows Server 2008 R2 Hyper-V guest OSes setup to run on specific NUMA nodes.  How will the SP1 update enabling Dynamic Memory impact these affinity settings?
A: With SP1, it`s actually possible to control whether NUMA spanning is allowed. You may have a performance impact if VMs uses memory from more than one NUMA node, but Hyper-V will try to minimize the spanning - though it would use memory from more than 1 NUMA node if there is no other way. You can also simply turn off the NUMA spanning in the Hyper-V setting in Hyper-V Manager. When you disable NUMA node spanning, you make the system behave like multiple small computers
Q: I am preparing to install 2008 R2 SP1 on a 2 node Hyper-V cluster, currently running 2008 R2 Datacenter. Is there anything I should be aware of before applying SP1?
A: You should not configure the dynamic memory settings on the VMs before every node is updated with SP1. Just simply migrate the VMs from the node you intend to update, and remove them back again when you update the second, and third, and so on. When every node is updated, you should install the new IC within the guest, power off your VMs, and configure Dynamic Memory. Remember that if some of your VMs run Windows Server 2008 R2 Web/Standard, you need to install SP1 within the guest to support dynamic memory.
Q: After upgrading the guest to the latest IC, do all guests have to be shut down simultaneously before enabling dynamic memory, or can I enable dynamic memory and reboot the guests one at a time?
A: No. The Dynamic Memory setting is individual to each machine, so there is no problem if you decide to enable Dynamic Memory on one machine at a time.
The important thing is to not enable dynamic memory on a VM before every node is updated with SP1 - in case of a migration /failover
Q: Why are the Dynamic Memory option is available for all of my VMs, even the VMs who is running Windows XP?
A: The Dynamic Memory feature is a global setting in Hyper-V, which is available at the highest level. Though it`s visible on every VM, does not mean that it support every guest OS.
Q: What is the correct version of the VMBus after updating the IC?
A: The correct version of the VMBus should be 6.1.7601.17514 after you have installed SP1 on your Hyper-V host, and updated your supported guest OS with the new IC.
Q: How can I monitor Dynamic Memory?
A: There are two new performance counters (perfmon) available after you have installed SP1 .
‘Hyper-V Dynamic Memory Balancer’, and ‘Hyper-V Dynamic Memory VM’. In addition, there is also three new columns in Hyper-V Manager related to Dynamic Memory. ‘Assigned Memory’, ‘Memory Demand’, and ‘Memory Status’.
Q: I need to find some information regarding RemoteFX compatibility list – but where?
A: Check this article: http://technet.microsoft.com/en-us/library/ff817602(WS.10).aspx which contains additional links for GPU`s that will work with RemoteFX

I`ll guess this one will be frequently updated during the next days/weeks.

(Do not hesitate to ask us in the Hyper-V TechNet Forum if you did not find the answer to your question in this post.)

Cheers,

Wednesday, February 16, 2011

Windows Server 2008 R2 SP1 RTM.

Just released and available on MSDN (February 16, 2011)

If you already have the RC version installed, you need to uninstall it before installing the RTM version. (No in-place upgrade)

I will upgrade my lab tonight, and show you how you should upgrade the cluster nodes in my next post, and also provide a FAQ regarding SP1 (RemoteFX and Dynamic Memory) based on the activity in the Hyper-V forum at Microsoft TechNet




Thursday, February 10, 2011

Windows Server 2008 R2 and Windows 7 SP1 - RTM (how to trick your VM)


SP1 for Windows Server 2008 R2 and Windows 7 is ready to reach every datacenter around the world.

I have been running the SP1 for a while now, and it has been a success.
One of the greatest advantages provided by Dynamic Memory is the capacity planning part.
A server with 48GB RAM using 70-80% of it, was reduced to 30-40%. And for the cluster, I only need to calculate the startup-RAM in case of failover.

And that`s what is all about – to utilize your server hardware.

I`ve tested various server setups with Dynamic Memory enabled, to see how it acts.
One of the first challenges, was to get pass the memory requirements during install,
(If you install SCVMM for example, it requires 2GB RAM).
There is an easy trick to bypass this one. The answer is mspaint.
Launch mspaint, go to file à Settings, and tweak the pixels so that the VM use more memory.
Once it`s passed the requirement, continue with your setup.

1. Before
2. After


(This is an old trick. I knew a fellow that actually complained about his computer RAM-use to his boss, and claimed a new computer. He only ran mspaint and no other applications… he got himself a new computer the week after… )
when the VM was not aware of anything else than the assigned startup RAM.

Tuesday, November 9, 2010

Getting started with Dynamic Memory in Windows Server 2008 R2 SP 1

With Windows Server 2008 R2 SP1, the new Dynamic Memory feature provides a means to increase the virtual machine density on your Hyper-V host, and use system memory more effectively by dynamically adding and removing memory from virtual machines as required by workloads. In order to start testing Hyper-V Dynamic Memory, I would like to mention some basic things about the Dynamic Memory feature in SP1 for Windows Server 2008 R2.

First thing first: Which guest operating system will support this feature (also after beta/RC)

·         Windows Server 2003 Web, Standard, Enterprise, Datacenter (x86 and x64)
·         Windows Server 2003 R2 Web, Standard, Enterprise, Datacenter (x86 and x64)
·         Windows Server 2008 Web, Standard, Enterprise, Datacenter (x86 and x64)
·         Windows server 2008 R2 Web, Standard, Enterprise, Datacenter (x86 and x64)
·         Windows Vista Enterprise and Ultimate (x86 and x64)
·         Windows 7 Enterprise and Ultimate (x86 and x64)

You can download the SP1 RC from here
(If you have installed the Beta version of SP1, you have to uninstall this one before the RC version)

After the install, configure the important registry setting in Windows, so that your parent will have enough RAM to function.

If we take another look at the supported guest operating systems above, we know that we have to mention for them as well, that the host now supports dynamic memory. To do this, we have to install the new version of IC.
This is relative simple.

1.       Start up your VMs
2.       Click ‘Action’ à ‘Insert the Integration Services Setup Disk’

3.       Choose to install this new version, and shut down your VMs.

Now, lets take a look at the settings on a VM.

In Hyper-V Manager, select one of your VMs that has the updated version of IC installed, and select ‘Settings..’
Select Memory, and configure the Dynamic setting.
In this example, I set 512MB as the Startup RAM. This amount of RAM is allocated from the host every time the VM starts up. The ‘Maximum RAM’ setting is as it mention, - the maximum RAM that the VM can use  from the parent.
(You can also set priority on your VMs, on how they will line up for available memory from the parent based on their needs.)

Now, let us start up this VM, and try to stress the use of RAM.
As you can see, the VM demand some extra RAM (in this case I am installing SQL Express on my VM).

Congratulate, you are now ready to play around with the Dynamic Memory feature.

I also have to mention that there are some new performance counters related to Dynamic Memory in the parent partition.


Also check out Brian`s post for a great perspective of how you can use the Dynamic Memory feature for better understanding of your applications: http://itproctology.blogspot.com/2010/09/hyper-v-dynamic-memory-as-tool-for.html


Thursday, October 7, 2010

Important registry setting in Windows Server 2008 R2 SP1

Since SP1 supports ‘Dynamic Memory’, your VMs could consume almost all available memory on the host, and leave 'nothing' for the parent partition.
A new registry key is now available:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Virtualization
REG_DWORD value
Name = MemoryReserve
Setting= amount of MB to reserve for the parent partition (recommend minimum 2GB)
You have to reboot your host to let the changes take effect.