Physical Server or a Virtual Machine?

  • Comments posted to this topic are about the item Physical Server or a Virtual Machine?

  • 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

  • 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.

  • 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.

  • 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.

  • 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.

  • 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.

  • 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.

  • 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..."

  • 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"

  • 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:

    http://blogs.technet.com/b/mattmcspirit/archive/2008/05/16/getting-my-head-around-the-hyper-v-architecture.aspx

  • 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