how to find a Server .. IS Physical machine or Virtual Machine

  • Is there any way to find the server is Physical machine or Virtual machine

    Thanks

    John

  • Given the way these packages work they try to insulate the OS from the HW so it is kind of hard to determine.

    You could likely look in the registry to see if VM tools are installed, such as VMWare or Sun Virtual Box or Hyper-V. They all have tools installs, not 100% foolproof but a start.

    Anybody done this successfully?

    CEWII

  • Along with VMWare tools you can open a command prompt and type in "systeminfo".

    It will spit out a good many lines but go back to the start and you will see System Manufacturer and System Type. For a VMware environment this will show you "Vmware, Inc." for Manufacturer and "VMware Virtual Platform" for Model. I'm not sure what HyperV will show you, but I'm sure something similar.

    Shawn Melton
    Twitter: @wsmelton
    Blog: wsmelton.github.com
    Github: wsmelton

  • Simple trick we used to use was to RDC into the box and check the TSR tray in the bottom right for the VM software.


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • Craig Farrell (12/13/2010)


    Simple trick we used to use was to RDC into the box and check the TSR tray in the bottom right for the VM software.

    That's a trick I use as well.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • This powershell resource might be of assistance as well.

    http://powershell.com/cs/forums/p/3255/4443.aspx

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Shawn Melton (12/13/2010)


    Along with VMWare tools you can open a command prompt and type in "systeminfo".

    It will spit out a good many lines but go back to the start and you will see System Manufacturer and System Type. For a VMware environment this will show you "Vmware, Inc." for Manufacturer and "VMware Virtual Platform" for Model. I'm not sure what HyperV will show you, but I'm sure something similar.

    This is my way too... can also be part of an automated job that collects a lot more info about each server in a much large set 😀

  • Craig Farrell (12/13/2010)


    Simple trick we used to use was to RDC into the box and check the TSR tray in the bottom right for the VM software.

    Not that I have seen it anywhere yet, but that tray icon can be turned off. Again I don't know why you would want to, just an FYI.

    Shawn Melton
    Twitter: @wsmelton
    Blog: wsmelton.github.com
    Github: wsmelton

  • It may have to do with, do you only want to know if it is a "virtual machine", or is it part of a Windows clustered environment. In both cases, the name of the physical server will not typically show up in the server name. In a TRUE virtual environment (i.e. non-clustered) you will have the virtual operating system be reported instead of the actual physical server. In a clustered environment, the physical server(s) are typically different than the SQL cluster resource group name.

    Recall that instance names are : <logical server or cluster resource group name>/InstanceName

    A logical server can be physical or virtual, but it will be a Windows operating system. The physical server hosting a virtual server can be (and in my experience typically is) non-Windows based. I have not found a way to "break-through" the virtual o/s to interrogate the physical o/s.

    If someone can provide a programmatic way of determining this (as opposed to looking at a GUI), that would be great - as it is a question I have had for quite some time.

  • tried using select @@version?

  • Even I follow the same trick mentioned by Shawn to find machine type.

  • You can query the WMI class Win32_ComputerSystem and look at Manufacturer and Model.

    This works against a Win 2008R2 and Win 2000. Which would mean that everything in between also works.

    For a vSphere I got

    Manufacturer: VMware, Inc.

    Model: VMware Virtual Platform

    For a Virtualbox I got:

    Manufacturer: innotek GmbH

    Model: VirtualBox

    CEWII

  • Does the same trick work for Hyper-V?

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Shawn Melton (12/13/2010)


    Along with VMWare tools you can open a command prompt and type in "systeminfo".

    It will spit out a good many lines but go back to the start and you will see System Manufacturer and System Type. For a VMware environment this will show you "Vmware, Inc." for Manufacturer and "VMware Virtual Platform" for Model. I'm not sure what HyperV will show you, but I'm sure something similar.

    For GUI use, I usually prefer something like Piriform's Speccy, but systeminfo comes built in to modern Windows.

    Here's a little bit of information for IDing your platform, and a lot of open questions

    Hyper-V guest:

    System Manufacturer: Microsoft Corporation

    System Model: Virtual Machine

    MS Virtual PC guest:

    System Manufacturer: Microsoft Corporation

    System Model: Virtual Machine

    VMWare ESXi with vCenter guest:

    System Manufacturer: VMware, Inc.

    System Model: VMware Virtual Platform

    VMWare ESXi standalone guest:

    ?

    VMWare Workstation guest:

    ?

    VMWare Player guest:

    ?

    VMWare Fusion guest:

    ?

    Virtualbox Community guest:

    ?

    Virtualbox paid edition guest:

    ?

    Xen guest:

    ?

  • SQL 2008 R2 has an attribute in sys.dm_os_sys_info called virtual_machine_type. That field should give you the information you seek.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

Viewing 15 posts - 1 through 15 (of 25 total)

You must be logged in to reply to this topic. Login to reply