May 23, 2014 at 3:17 pm
Comments posted to this topic are about the item Physical Server or a Virtual Machine?
May 27, 2014 at 11:01 am
It's nice that SQL2008R2 now has that DVM.
But for other systems, we can use a more... let's call it brute
----------------------
declare
@VirOrPhys[nvarchar](50),@manu-2[nvarchar](50)
create table #OSinfo(OSinfo varchar (255))
insert into #OSinfo
exec master..xp_cmdshell 'systeminfo'
set @manu-2 =(select ltrim(SUBSTRING(OSinfo,CHARINDEX(' ',OSinfo),LEN(OSinfo)))
from #OSinfo
where OSinfo like '%System%' and
OSinfo like '%Manufacture%')
if (@Manu not like '%VMware%')
begin
set @VirOrPhys='Not Virtual'
end
else
begin
set @VirOrPhys='Virtual'
end
select @VirOrPhys, @manu-2
DROP TABLE #OSinfo
July 14, 2014 at 4:33 am
I just tried both versions included in the SQL from the article on my local machine which is running SQL 2008 R2 SP2 on 64bit Windows 8.1 (latest updates) and returns "virtual" in the results which is not correct.
My only thought is that it is because I have the HyperV client installed on my machine which enables me to run VMs from our central VM server locally so I don't have to compete for resources.
July 14, 2014 at 4:41 am
From MS help for the sys.dm_os_sys_info view, note the bit I have added bold highlight to - WTF!:
virtual_machine_type_desc - nvarchar(60) - Describes the virtual_machine_type column. Not nullable.
ValueDescription:
None - SQL Server is not running inside a virtual machine.
HYPERVISOR - SQL Server is running inside a hypervisor, which implies a hardware-assisted virtualization. If the instance is running on the host OS, the description will still return HYPERVISOR.
Other -SQL Server is running inside a virtual machine that does not employ hardware assistant such as Microsoft Virtual PC.
July 22, 2014 at 5:10 am
peter.row (7/14/2014)
If the instance is running on the host OS, the description will still return HYPERVISOR.
This will probably depend on the type of Hypervisor being used, from Wikipedia:
Type 1 (or native, bare metal) hypervisors run directly on the host's hardware to control the hardware and to manage guest operating systems. A guest operating-system thus runs on another level above the hypervisor. This model represents the classic implementation of virtual-machine architectures; IBM developed the original hypervisors as bare-metal tools in the 1960s: the test tool, SIMMON, and CP/CMS. CP/CMS was the ancestor of IBM's z/VM. Modern equivalents include Oracle VM Server for SPARC, Oracle VM Server for x86, the Citrix XenServer, VMware ESX/ESXi and Microsoft Hyper-V 2008/2012.
Type 2 (or hosted) hypervisors run within a conventional operating-system environment. With the hypervisor layer as a distinct second software level, guest operating-systems run at the third level above the hardware. VMware Workstation and VirtualBox exemplify Type 2 hypervisors.
http://en.wikipedia.org/wiki/Hypervisor
So for a Windows system using Hyper-V, the host OS itself is actually virtual.
July 30, 2014 at 2:00 am
Well as mentioned originally I tested this on my Window 8.1.1 64Bit machine with SQL Server 2008 R2 (SP2) 64Bit which also happens to have the Hyper-V Manager (client) installed on it.
SQL Server is running directly on my physical machine it is not virtualised.
Therefore given the above if the SQL Servers SP is going to still saying that it running virtual that makes the results of the SP unreliable as in the above case it is simply not true.
August 5, 2014 at 9:27 am
peter.row (7/14/2014)
My only thought is that it is because I have the HyperV client installed on my machine which enables me to run VMs from our central VM server locally so I don't have to compete for resources.
How are you able to run VMs locally with only the 'client' installed?
I have a Windows Server 2012 machine running SQL 2008R2 and this query returns "Physical".
It has the "Hyper-V Management Tools" installed (Manage Roles and Features -> Features -> Remote Server Administration Tools -> Role Administration Tools -> Hyper-V Management Tools) and I can remotely administer VMs running on different machines, but no VMs are running on this machine as the Hyper-V role itself is not installed.
August 5, 2014 at 9:33 am
My mistake I have the Hyper-V Manager installed on my Win 8.1 Enterprise box.
Under windows features this is listed at the bottom of the umbrella Hyper-V tree item as:
- Hyper-V GUI Management Tools
- Hyper-V Module for Windows Powershell
- Hyper-V Platform
Mistake aside the ultimate point is that I am running SQL Server 2008R2 on my actual Win8.1 box not on a Hyper-V VM but yet the command does not return "physical" which it should.
August 5, 2014 at 9:43 am
If you have the Hyper-V Platform role installed then your 'host' OS is indeed running inside a hypervisor - everything is as Hyper-V is a Type 1 Hypervisor.
At the command prompt type "systeminfo" (no quotes) and the last line should be "A hypervisor has been detected..."
August 6, 2014 at 1:20 am
Dan Messenger (8/5/2014)
If you have the Hyper-V Platform role installed then your 'host' OS is indeed running inside a hypervisor - everything is as Hyper-V is a Type 1 Hypervisor.At the command prompt type "systeminfo" (no quotes) and the last line should be "A hypervisor has been detected..."
That is what it says.
I must say I don't truly understand - the one and only reason I installed it was so that I could copy VMs from our Hyper-V server at work and not compete for resources since the VM would be running locally.
I have a hard time wrapping my head around that statement. My machine starts up with Win 8.1 running without any VM layer then I install a component of Windows and all of a sudden my whole OS is now running inside a VM?
I need to search for "Type 1 Hypervisor"
August 6, 2014 at 2:20 am
Yes, your Win8.1 would be running as a VM. However, for the most part you won't even notice.
This article has a pretty good explanation, in the examples given the parent partition would be your Win8.1 install:
September 9, 2015 at 6:56 am
Sounds cool, I'll try it.
Viewing 12 posts - 1 through 11 (of 11 total)
You must be logged in to reply to this topic. Login to reply