Determine System Model

see *https://twitter.com/SterbalRobert/status/773898107037835264

Glen Berry (@GlennAlanBerry) Is there a good way of telling if a machine is a VM from the DMVs?

One Line version if (object_id('tempdb..#ServerInfo') is not null) drop table #ServerInfo create table #ServerInfo (Logdate varchar(50), ProcessInfo varchar(256), Model varchar(1000)) insert into #ServerInfo(LogDate,ProcessInfo,Model) EXEC ('sys.xp_readerrorlog 0, 1, NManufacturer) select model 'System Manufacturer and System Model (virtual machines are VMWare)' from #ServerInfo -- EXEC ('sys.xp_readerrorlog 0, 1, NManufacturer)

Block Version if (object_id('tempdb..#ServerInfo') is not null) drop table #ServerInfo create table #ServerInfo (Logdate varchar(50), ProcessInfo varchar(256), Model varchar(1000)) insert into #ServerInfo(LogDate,ProcessInfo,Model) EXEC ('sys.xp_readerrorlog 0, 1, NManufacturer') select model 'System Manufacturer and System Model (virtual machines are VMWare)' from #ServerInfo -- EXEC ('sys.xp_readerrorlog 0, 1, NManufacturer')