Monday, 2 April 2012

Get Hyper-V Virtual Machine Process ID and GUID


Get Hyper-V Virtual Machine Process ID and GUID


Overview

When needing to manipulate a virtual machine - either kill it if it's unresponsive, or do other management tasks such as working with virtual disks or snapshots and even fixing specific issues with NTFS file permissions - it may be useful to know the virtual machine ID or GUID.  In this brief article, we'll show you where to find the process ID and GUID.

Find Virtual Machine GUID in XML Config File

If you look at the folder where the VM is located, you'll find an .XML file that contains the configuration information for the VM. This file name uses a long GUID string, which in fact is identical to the VM's GUID.

Other Methods to Obtain ID and GUID

This is a good script written by Michael Michael from Microsoft. It will give you a list of all VMs in a hyper-v system as well as their respective BIOS GUIDs.



Next, a good resource to know, the PowerShell management Library for Hyper-V, a project to provide a PowerShell management library for Hyper-V. It does pretty much what it says, with 80 functions in the library.


PowerShell Management Library for Hyper-V
http://pshyperv.codeplex.com
After importing the management library, run a command such as this one:
get-vm | ft ElementName,name

Another easy to use method is by querying the WMI repository.
Copy the following command and enter it in a PowerShell window with elevated credentials:
Get-WmiObject -Namespace root\virtualization -class msvm_computersystem | select elementname, operationalstatus, processid, name| ft -auto
For example:

After finding either the Process ID or the GUID, here is how you can kill a hung VM without affecting the other VMs on the host.


Summary

Knowing a VM's ID or GUID can be useful whenever you need kill a hung VM or do other management tasks to a specific VM, especially if there are multiple VM's running on one machine.  I hope this brief article has shown you some useful ways of obtaining a VM's ID and GUID.

Killing a Hung Virtual Machine on Hyper-V


Killing a Hung Virtual Machine on Hyper-V

Overview
Hyper-V virtual machines usually run without any special issues that cause them to become unresponsive or hung. However, sometimes, for no apparent reason, a VM might seem to hang on the Hyper-V host and nothing you do will close it even if you attempt to shut it down, turn it off, reboot or reset it. Using the Hyper-V Management Console or System Center Virtual Machine Manager (SCVMM) to kill the VM will not work, and the last resort will seem to be to reboot the Hyper-V host itself.
However, rebooting the host will probably affect other VMs that run on the same host. If you're using a Hyper-V Failover Cluster you may be able to move the other VMs to anther node in the cluster which will leave just the failed VM on the host. But what if you don't have a cluster in place and have just one or two hosts that run several VMs?
If it was a "normal" process, you could probably use Task Manager to find the hung process and terminate it. But how do you find the process of the entire VM?



Killing Hung VMs

Task Manager shows a process called VMWP.EXE. This is the virtual machine worker process that runs for every VM that is currently running.
Kill Hung VM
In the above example you only see two instances, but on a production host there may be many instances of the process running. So how can you identify which VMWP.EXE process is the one running for the hung VM?

After finding either the Process ID or the GUID, here is how you can kill a hung VM without affecting the other VMs on the host.
Note: It is always better to properly shut down a VM. If you cannot shut it down, turn it off. Use this tip only if there is no alternative. Remember that killing a VM might corrupt the .VHD file(s) and might cause you to either lose data that was not properly committed to the disk, lose the VM's integrity, or both.

Method 1: Using Task Manager
1. Open Task Manager and click on the Processes tab.
2. Locate the VMWP.EXE processes.
3. Click on View, then click Select  Columns.
Kill Hung VM
4. In the Select Process Page Columns list, select Command Line and click Ok.
Kill Hung VM
5. Back in the Processes tab, expand the Command Line column to be able to see the entire line(s). Locate the VMWP.EXE processes (you will have one for every VM that is running).
Kill Hung VM
6. Note the GUID for the running VMs. Find the one that matches the VM you wish to kill. Right-click the process and select End Process. Acknowledge the message.
Kill Hung VM
Note: You can also use the Process ID parameter to kill the correct VMWP.EXE process.
Method 2: Using Sysinternals Process Explorer
1. Download Sysinternals Process Explorer from the following link:
http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx
2. Extract the files(s) to a folder of your choice, then double-click PROCEXP.EXE. Acknowledge the EULA message. Also acknowledge the security warning, if you get one.
3. In Process Explorer, click File > Show Details got All Processes.
Sysinternals Process Explorer
4. Acknowledge the UAC message, if you get one.
Sysinternals Process Explorer
5. Locate the VMWP.EXE processes (you will have one for every VM that is running). Hover with your mouse over the process to see the balloon message. It will give you an indication of the VM's GUID.
Sysinternals Process Explorer


6. Find the one that matches the VM you wish to kill.Right-click and select Kill Process. Acknowledge the message.
Kill Hung VM
Note: Again, you can also use the Process ID parameter to kill the correct VMWP.EXE process.

Summary

It's not all that common (hopefully) but it is possible that a VM will hang and it can be very difficult to kill the hung VM if other VM's are running on the host machine.  Hopefully this article walks you through what should be considered to be a "last resort" method of killing the hung VM.

Sunday, 1 April 2012

What is StreamInsight?


What is StreamInsight?



What does StreamInsight mean for customers?
While OLTP databases have matured and are capable of processing thousands of transactions per second; they are not optimized for processing continuous high volume, low latency streams of data. Microsoft’s innovative StreamInsight™ platform allows customers to use their own proprietary algorithms to build custom real-time applications, ISVs to build industry specific solutions and embedded system developers to offer low latency processing.


What are the key benefits for supporting complex event processing?
The benefits vary by industry and scenario but all are a result of the ability to process large volumes of time varying events/data with very low latency and to take action(s) as a result. For example ability to mine trading opportunities in almost real time in stock markets.
Why is Microsoft making this investment?
Microsoft is committed to enabling customers to better manage their business through quick and effective processing of information. Microsoft is delivering on its promise of “Enabling customers of all sizes to derive value from ALL data, birth through archival". Besides allowing customers the flexibility to develop their own applications, Microsoft is committed to enabling ISVs and embedded system developers to develop products and solutions that customers can exploit.
Are there specific customers with whom Microsoft has been testing this functionality to date?
Many customers have expressed excitement about this functionality. We will publish more information on customer references closer to the release.
When will this technology be available for customers?
StreamInsight™ will be released as part of SQL Server 2008 R2 release which is expected in H2 fiscal year 2010.
How will StreamInsight™ be licensed and priced?
As of today we have not committed to any pricing or licensing strategies. More information will be available as we get closer to the release in H2 2010.

Do I need to install any other software to take advantage of this support?
StreamInsight™ will require Windows XP/Windows Server 2003 or higher, .NET Fx 3.5 or higher and Microsoft Visual Studio 2008 or higher for development.
Are there benchmark results which support performance expectations for StreamInsight™?
There are no benchmark results available today. We will provide more guidance on actual scalability of specific workloads when we are closer to release. We will consider industry standard benchmarks.
What applications are most likely to need support for StreamInsight™?
Applications that require extremely low latency processing with high scale and performance include:
  • Process monitoring i.e. scheduling, control, and inventory including processing such as RFID, bar codes, process monitoring at oil and gas refinery.
  • Financial algorithmic trading, compliance monitoring, fraud detection, risk management
  • Click stream analysis on websites , context sensitive navigation and ad-delivery model
  • Utility grid monitoring – demand from meters and supply from generation units combined with energy trading
  • Patient Monitoring (Healthcare)
  • Network traffic monitoring, security intrusion detection
  • IT monitoring
  • Telecom network monitoring
  • Anomaly detection


Will StreamInsight™ work/interoperate with non-Microsoft platforms?
StreamInsight™ was not architected/designed with a specific platform in mind. The platform can integrate with other data sources and sinks with the help of right set of adapters.
How is Microsoft fostering development of adapters?
Microsoft is committed to the development of a healthy adapter eco system. Microsoft will be providing an adapter development kit (ADK) with a reference implementation.
What does this announcement mean for partners?
Our partners such as ISVs, embedded system developers and adapter developers will get opportunities to differentiate their product in solution capabilities and performance based on our platform. Partners will be able to save development cost and develop solutions faster using a platform based on a set of proven and mature tools and technologies. High performance and complex query capabilities amongst other features enables development of custom or industry solutions for a variety of industries and scenarios. The ease of development and ready availability of skilled resources will enable customers that have not been able to take advantage to build applications using the technology. Implementation of this support by vendors ensures customer has the options and is able to choose the solutions built on an enterprise class platform that best suits their business.
With which ISVs is Microsoft working now?
We are working with many vendors to build solutions around the platforms. Several end user scenarios require use of this technology and platform. The technology will enable actions and business decision in near real time based on complex processing logic uniquely defined by the needs of the business 

What is Application and Multi-server Management in SQL Server 2008 R2?


What is Application and Multi-server Management in SQL Server 2008 R2?

What is Application and Multi-server Management?
Microsoft’s investments in Application and Multi-server Management will help organizations manage database environments more efficiently at scale with visibility into resource utilization for consolidation and improved efficiencies across the application lifecycle. These improvements will offer DBAs increased visibility and control, resource optimization, and efficiencies, ultimately leading to a healthier, more stable environment.
How does Application and Multi-server Management work?
A new control point explorer in SQL Server Management Studio allows DBAs to enroll SQL Server instances across their environment into centralized multi-server management. Once enrolled, DBAs can adjust default capacity policies to define desired utilization across instances or applications. Dashboard viewpoints provide insight into utilization and policy violation to help identify consolidation opportunities, maximize investments and ultimately maintain healthier systems. Meanwhile, the introduction of a Data-tier Application, a single unit of deployment, helps significantly streamline SQL Server consolidation and upgrade initiatives.

How does the Application and Multi-server Management feature improve efficiencies?
Interoperability with Visual Studio 2010 introduces a new project template which produces Data-tier Applications. This project template captures the database application schema (tables, stored procedures, etc) and packages it with application deployment requirements, enabling a single unit of deployment. A new central control point in SQL Server enables DBAs to more quickly deploy these application packages to available instances that meet defined deployment requirements. These capabilities reduce trial and error associated with deployments streamlining SQL Server consolidation and upgrade initiatives. The SQL Server control point also provides broad control over the hardware utilization of the database environment, enabling hardware to be more fully utilized and reducing administration costs.
How will Application and Multi-server Management investments help organizations do more with less in a difficult economic climate?
By centralizing the capacity management of SQL Server instances and data-tier applications, DBAs will gain visibility into utilization across their environment which will help streamline consolidation initiatives to help save money. Dashboard insights into both database instance and database utilization will help DBAs make better decisions about resource allocation—including identifying consolidation opportunities and potential performance issues.
Furthermore, DBAs will find it easier and faster to move, upgrade and deploy databases applications with the introduction of a new Data-tier Application, a single unit of deployment.
By extending the power of Policy-Based Management to application and multi-server management, DBAs will proactively manage application and instance capacity to help ensure service quality.
How do the Application and Multi-server Management investments leverage the power of Visual Studio?
Utilizing future capabilities in Visual Studio, developers will create deployable packages through a new project type, define database schema and deployment requirements for application components, and handoff these bundled components to administrators. This will streamline collaboration between data-tier developers and DBAs and help enable quicker deployments. Policy-Based Management is extended through these new capabilities in Visual Studio enabling developers to bundle deployment requirements with their projects— for example, “the application must be installed on SQL Server 2008 or later.”

This sounds a lot like Systems Center Operations Manager (SCOM) functionality. How are these products different?
System Center has a broad charter which looks across all Microsoft products within the IT environment including managing physical instances, or hardware assets. SQL Server’s investments in application and multi-server management functionality focus strictly on the DBA’s role at a deep level, the data-tier applications and database instances on which they reside to help facilitate centralized database management, improve resource utilization, and manage instances and application components at scale.

How do I get Application and Multi-server Management?
Application and Multi-Server Management capabilities will be available in SQL Server 2008 R2. At this time, we have not disclosed which SQL Server editions will contain this functionality. However, you can download SQL Server 2008 R2 CTP2 and try the beta for free today!
What do these investments cost?
We have not yet committed to any pricing or packaging strategies. More information will be available as we get closer to the release of SQL Server 2008 R2 in H1 2010.
What Application and Multi-server Management capabilities are available in the August CTP?
With the SQL Server 2008 R2 August CTP, customers can perform the following functions:
  • Set up a central management point (SQL Server Control Point).
  • Use the Control Point Explorer to enroll SQL Server instances into the SQL Server Control Point for centralized capacity management and policy-based evaluation.
  • Extract Data-tier Applications, a single unit of deployment, from existing deployed database applications from SQL Server 2000 to SQL Server 2008 R2.
  • Deploy Data-tier Applications to SQL Server 2008 R2 databases.
  • Use the SQL Server Control Point to view at-a-glance dashboard viewpoints for insights into utilization and policy violation.
  • Extensions to Policy-Based Management in the SQL Server Control Point deliver default utilization policies while fine-tuning slider bars enable you to adjust utilization thresholds within seconds.

What is PowerPivot?


What is PowerPivot?


What is PowerPivot?
PowerPivot (formerly known as Project Gemini) is our latest and hottest business intelligence innovation and intended to finally make BI accessible & easy to the masses using the #1 BI tool in the world: Microsoft Excel. PowerPivot actually consist of a client add-in for Excel 2010 called PowerPivot for Excel and a server component called PowerPivot for SharePoint 2010.


PowerPivot for Excel is an add-in to Excel 2010 that provides you with the capability to manipulate vast amounts of data using, integrate data from multiple data sources and share the results with others – with little or no assistance from IT
PowerPivot for SharePoint is nothing but SQL Server 2008 R2 Analysis Services running in Vertipaq mode within SharePoint 2010. Vertipaq is the in-memory technology that enables fast data manipulation in Excel Services and also enables efficient share & collaboration across your organization. In addition, PowerPivot for SharePoint offers IT administrators the ability to monitor and control self-service BI (when uploaded in SharePoint 2010) thru its IT Operation Dashboard
How does PowerPivot relate to “Managed Self-Service BI”?
PowerPivot for Excel enhances self-service BI capabilities by providing you with greater flexibility of data manipulation using any size data set in structured or unstructured form using the familiar Office interface.


In addition, you can publish your analysis in SharePoint 2010 as a web application and share it with insights with your co-workers.
“Managed” Self Service BI means that IT also benefits greatly with PowerPivot. They can provision reports – thus providing a single version of truth – and have end users work directly with data from those reports via Data Feeds. In addition, IT can track the usage of PowerPivot applications and discovering mission-critical Excel applications.
What are some examples of data sources that PowerPivot for Excel can use?
PowerPivot for Excel can use any data source. Some examples include existing OLAP cubes, ATOM feeds with tabular data, Paste/Append & Paste/Replace any tabular data, Excel Pivot Tables, and structured relational databases.
How is referential integrity managed, especially when adding multiple data sets from various sources?
You can fix referential integrity issues using DAX expressions. PowerPivot for Excel also supports NULL/unknown members, similar to classic Analysis Services.

Where can I find out more about PowerPivot for Excel? How much does it cost and where can I download it?
Licensing has not yet been determined. Learn more and download the PowerPivot client at http://www.powerpivot.com
Can I have a standalone PowerPivot for Excel installation without SQL Server 2008 R2?
Yes. The PowerPivot for Excel client does not require anything else besides a simple installer and does not required SQL Server 2008 R2 running in your local machine. The client component is a standalone Excel 2010 add-in that can query any data source, including SQL Server.
Does PowerPivot for Excel depend on SharePoint 2010?
The only client dependency is Excel 2010. It will not work with earlier versions of Excel.


The server component (PowerPivot for SharePoint) requires both SQL Server 2008 R2 and SharePoint 2010. To enable sharing and collaboration on PowerPivot for Excel applications and models, you must install SQL Server 2008 R2 as part of the SharePoint farm.
What version of Office supports the PowerPivot for Excel client?
PowerPivot for Excel only works with Office 2010.
Can I edit a PowerPivot for Excel application within SharePoint 2010 if I don't have Office 2010?
Without the Excel add-in, you cannot edit PowerPivot models. You are restricted to viewing and using the models online through SharePoint. 

How to Plan SQL Server Database Files


How to Plan SQL Server Database Files


One of the most important tasks you can do in SQL Server is to setup your data and log files.  Not getting these files setup correctly can be one of the biggest causes for production problems whether it’s disk contention, space usage, or something else.  And honestly this level of planning is often overlooked and by the time the problem is discovered the application and its users have already suffered.  So let’s get into some good discussion about how to setup your database files.

Log files

We’re going to start with logs first because they’re the easiest and probably the ones you’ll touch most frequently.  And we need to talk about placing your log files on disk first.  In general, you’ll want to place your log files on a different physical partition than your data files.  This is for 2 reasons.  The first is disk contention.  Every transaction has to write something to the log file before it can write it to the data file and if both files are on the same disk, then the disk arm has to work twice has hard because it has to jump over here to write the log and then jump over there to write to the table.  Putting a log file on its own disk is also better for the performance of the log because logs write sequentially so if the log file is on its own disk the disk arm has very little moving to do to get to the next place it needs to write so it’s much faster.  The second reason you want data and log files on separate disks is for recovery.  If the data partition fails you’ll want the log on a separate set of disks so you can still recover the logs and roll the last transactions forward so you don’t lose any data.



Several log files

It’s a common misconception that you will get a performance gain by using several log files.  This is something we see quite often and it simply isn’t true.  Log files are written sequentially which means that each log file is filled up before the next one is written to.  So if you have 4 log files (Log1, Log2, Log3, Log4), SQL Server 2008 will fill up Log1, then fill up Log2, etc.  This is different from the way data files behave and we’ll discuss that in a minute.  The only reason to have multiple log files on multiple partitions is for space.  You may need more disk than a single partition can provide.  Oh, and putting multiple log files on a single partition is just dumb.  It gains you nothing.

Data files

Now let’s talk about where you’ll place your data files.  As we’ve already said it’s a good idea to place them on a different physical partition from your log files. And we know we already said that, but experience has shown us that we could fill an entire page with that exact advice and a good portion of you still won’t grasp the importance of it.  So we’re really going to hammer that point home in this article.
So while your data files are separated from your log files you may feel free to have multiple data files on multiple physical partitions to take advantage of performance gains.  Now, we have to say again that these have to be physical partitions because logical partitions are still on the same physical disk and it’s the disk arm contention you’re trying to avoid.  Data files, unlike log files, use what’s known as an equal fill algorithm.  This means that all of the files are filled equally as much as possible.  So let’s say you have 4 data files (Data1, Data2, Data3, Data4).  When you write to the database, SQL Server 2008 will write to these files in a round robin fashion and they should grow at more or less the same rate.  You can also place tables inside specific files so you have a good level of control over how you split up the I/O workload in your database.  And while the number of files you need to optimize your workload is a subject that’s up for debate in the community, for most systems it won’t make that much difference.  However, it is a good idea that no matter how many data files you decide to have, to make them all the same size.  This goes back to that equal fill algorithm we were talking about before.



File growth

Another good topic is file growth.  This is a mistake that many beginners make.  They accept the defaults for file growth and that’s just asking for trouble.  We’re going to give you some advice on how to set your file growth and you can adjust it to suit your needs, but at least you’ll know the arguments.



  1. The best thing to do is to set both your data and your log files as large as you ever want them to be.  Depending on your version of SQL Server, it can be very expensive to grow files so setting their size ahead of time can alleviate performance problems before they even start.  So if you’ve got a single partition dedicated to your log file, then go ahead and make your log the same size as your partition.  If it’s dedicated then you’ve got nothing to lose.  And the same goes for your data files.  If they’re on dedicated partitions (and they should be), then you’ve got nothing to lose.
  2. The next best thing is to set your files to autogrow by fairly large predictable increments.  The default autogrowth is 1MB for data files and 10% for log files.  I always grow data files by at least 1GB and often times even more.  If you’re going to suffer the expense of growing a file you don’t want to do it 5 times a day, so make it worth your while.  And 10% is too unpredictable.  As the log grows the 10% marker is going to get bigger too so you’ll actually be growing your log more and more each time.
  3. Set all your data files to grow at the same rate, and all of your log files to grow at the same rate.  Your data files don’t have to grow at the same rate as your log files, but they should grow at the same rate as each other.
Here we talked about separating your data and log files onto separate partitions, as well as some of the theories on why we recommend the things we do. 

Troubleshooting a Slow Database Server: Is SQL Server the Cause?


Troubleshooting a Slow Database Server: Is SQL Server the Cause?


Troubleshooting a slow database server is one of the easiest and hardest things you’ll ever do in IT.  While there are some anomalies that can take a real performance expert several days to track down, most of the time your performance issues are going to be fairly straight forward.  The easy part is determining whether or not the issue is SQL-related and what form it’s taking.  The hard part can be determining exactly what the root cause of the issue is inside the SQL Server itself.  That is, does it stem from a bad query, parallelism, caching, too many compiles, bad execution plans, etc.


From an end user perspective, there’s no way of knowing where the slowdown is coming from.  It could logically be CPU, memory, disk, network, or any of the more specific sub-components of each of those broad categories.  So the first thing you need to do is to determine the offending component and then you can snipe the specific cause.
Let’s look at the easiest way to determine the over-arching cause of a system slowdown.
Open Perfmon (I’m assuming in this article that you already know the extreme basics of how to work Perfmon) and you’ll notice the following counters are already loaded into the collection:
  • Pages/sec
  • Avg. Disk Queue Length
  • % Processor Time
These are really good counters to start with because they cover 3 of the 5 major areas.  The ones that are missing are memory and network.  I’ll talk about network later, and memory isn’t that interesting to us here anyway so we really don’t need to investigate it in this first round.  Why?  Well because on a dedicated database box, SQL Server is going to use most of, if not all of the available memory by default so all you’ll see in Perfmon is that all the memory is being used.  So it really doesn’t help in this case.  You can get a hint that there may be something memory-related going on though by looking at the pages/sec counter.
I’m now going to talk about each one of these briefly to give you an idea of what to look for.

Pages/sec

This is how much paging your system is doing in and out of virtual memory.  If you’re doing a lot of paging then this could be an indication that you’ve got other applications on the box taking memory away from the database.  There’s no real right answer on what this counter should be so you should have a baseline to tell you how it usually operates.  It should be as close to 0 as possible though.  It’s also notable that this counter alone won’t really do much for you if you’re on a dedicated database box as databases don’t tend to page much, if any at all.  This is one reason why it’s good to know if your box is dedicated to SQL Server.

Avg. Disk Queue Length

This counter can be misleading because while you may be looking at what seems to be a high number, it may be perfectly fine for your system.  The general rule is that a disk queue should be the number of spindles x 2.  OK, so what does that mean?  I’ll give you a really simple example.  Let’s say you have only a single disk on your server; just a single SCSI hard drive and nothing else.  Your acceptable disk queue is 2 because you only have 1 spindle (hard drive) and you’re generally allowed a queue of 2 per spindle.  So if you have a SAN with 50 spindles in your array, your acceptable disk queue is 100 (that’s 50 x 2, right?).
So to get any real use out of this counter you’ll need to know something about the underlying storage, or you’ll have to have a baseline.  And again, I can’t stress the baseline enough because even though rule of thumb may allow you a disk queue of 100, if your system typically runs with a queue of 10-15, then 100 goes back to being unacceptable.  There’s simply no substitute for having a picture of normal conditions on your box.



% Processor Time

This counter can be taken at face value.  If you’re running a high CPU, then it’s a pretty good indicator that CPU is the culprit.  If this is the case then you’ll need to determine which process is using the lion’s share of the CPU though and that takes another counter.  If you do determine you’re looking at a CPU issue, then you’ll need to add in the Process\% Processor Time counter and either add the counter for all processes (don’t use _Total) or pick the most likely suspects and keep adding them until you find the offender.  If sqlserver.exe is the clear offender, then you can now either get your DBA involved or move to the internal SQL Server methods for troubleshooting performance issues.  And again, it’s best to have a baseline.  If your database is pegging the CPU at 93%, but it’s usually at 90-95%, then CPU probably isn’t your culprit because you’re operating within normal parameters.  So know what your system looks like when it’s running normally.



Networking

The reason why we’re not really worried about monitoring networking counters is because the only counters that would be of use to us are the internal windows and NIC counters, and these are rarely at fault.  If there is a network issue, it’s typically in the network itself which you can’t diagnose with any of these counters.  And while this happens from time to time, it’s really something you’ll check in round 4 or 5 of your troubleshooting and isn’t really interesting to us here in round 1.
These are the very basics of how to determine whether your database is causing your system slowdown.  And for every rule I gave above I can think of a handful of exceptions so nothing is written in stone.  You can use Task Manager if you like, but any questions that surface force you to open up Perfmon anyway, so you’d might as well start there.  Perfmon also allows you to save counter collections so you don’t have to redefine your measures every time.