SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Physical Server or a Virtual Machine?


Physical Server or a Virtual Machine?

Author
Message
Sreekanth B
Sreekanth B
Right there with Babe
Right there with Babe (765 reputation)Right there with Babe (765 reputation)Right there with Babe (765 reputation)Right there with Babe (765 reputation)Right there with Babe (765 reputation)Right there with Babe (765 reputation)Right there with Babe (765 reputation)Right there with Babe (765 reputation)

Group: General Forum Members
Points: 765 Visits: 2109
Comments posted to this topic are about the item Physical Server or a Virtual Machine?
MiguelSQL
MiguelSQL
Old Hand
Old Hand (364 reputation)Old Hand (364 reputation)Old Hand (364 reputation)Old Hand (364 reputation)Old Hand (364 reputation)Old Hand (364 reputation)Old Hand (364 reputation)Old Hand (364 reputation)

Group: General Forum Members
Points: 364 Visits: 1139
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 [nvarchar](50)

create table #OSinfo(OSinfo varchar (255))

insert into #OSinfo
exec master..xp_cmdshell 'systeminfo'

set @Manu = (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
DROP TABLE #OSinfo
peter.row
peter.row
SSChasing Mays
SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)

Group: General Forum Members
Points: 625 Visits: 412
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.
peter.row
peter.row
SSChasing Mays
SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)

Group: General Forum Members
Points: 625 Visits: 412
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.
Dan Messenger
Dan Messenger
Valued Member
Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)

Group: General Forum Members
Points: 64 Visits: 152
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.
peter.row
peter.row
SSChasing Mays
SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)

Group: General Forum Members
Points: 625 Visits: 412
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.
Dan Messenger
Dan Messenger
Valued Member
Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)

Group: General Forum Members
Points: 64 Visits: 152
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.
peter.row
peter.row
SSChasing Mays
SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)

Group: General Forum Members
Points: 625 Visits: 412
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.
Dan Messenger
Dan Messenger
Valued Member
Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)

Group: General Forum Members
Points: 64 Visits: 152
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..."
peter.row
peter.row
SSChasing Mays
SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)SSChasing Mays (625 reputation)

Group: General Forum Members
Points: 625 Visits: 412
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"
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search