Host parameter to check if it's virtual or bare-metal

Hi all,

I wonder if there is a host parameter – Boolean to tell whether the host
being rendered is a virtual machine or bare-metal. I would like to use it
in partitioning script to automatically give 'install-disk' a value that
matches.

Thanks
Chi

<% if @host.compute_resource -%>
virtual
<% else -%>
physical
<% end -%>

··· On 07/04/17 04:30, Chi Fu wrote: > Hi all, > > I wonder if there is a host parameter -- Boolean to tell whether the > host being rendered is a virtual machine or bare-metal. I would like to > use it in partitioning script to automatically give 'install-disk' a > value that matches.


Dominic Cleal
dominic@cleal.org

Thank you Dominic, that all worked

在 2017年4月7日星期五 UTC+8下午3:09:24,Dominic Cleal写道:

··· > > On 07/04/17 04:30, Chi Fu wrote: > > Hi all, > > > > I wonder if there is a host parameter -- Boolean to tell whether the > > host being rendered is a virtual machine or bare-metal. I would like to > > use it in partitioning script to automatically give 'install-disk' a > > value that matches. > > <% if @host.compute_resource -%> > virtual > <% else -%> > physical > <% end -%> > > -- > Dominic Cleal > dom...@cleal.org >