diff --git a/xCAT-server/lib/perl/xCAT/SvrUtils.pm b/xCAT-server/lib/perl/xCAT/SvrUtils.pm index b3624b067..72e3347bd 100644 --- a/xCAT-server/lib/perl/xCAT/SvrUtils.pm +++ b/xCAT-server/lib/perl/xCAT/SvrUtils.pm @@ -562,6 +562,10 @@ sub update_tables_with_templates $osname="windows"; $ostype="Windows"; $imagetype="windows"; + } elsif ($osver =~ /^hyperv/) { + $osname="hyperv"; + $ostype="Windows"; + $imagetype="windows"; } else { until (-r "$::XCATROOT/share/xcat/install/$osname/" or not $osname) { chop($osname); diff --git a/xCAT-server/lib/xcat/plugins/windows.pm b/xCAT-server/lib/xcat/plugins/windows.pm index 4526cd9dd..8bb313136 100644 --- a/xCAT-server/lib/xcat/plugins/windows.pm +++ b/xCAT-server/lib/xcat/plugins/windows.pm @@ -310,8 +310,14 @@ sub mkinstall next; } - my $tmplfile=xCAT::SvrUtils::get_tmpl_file_name("$installroot/custom/install/windows", $profile, $os, $arch); - if (! $tmplfile) { $tmplfile=xCAT::SvrUtils::get_tmpl_file_name("$::XCATROOT/share/xcat/install/windows", $profile, $os, $arch); } + my $custmplpath = "$installroot/custom/install/windows"; + my $tmplpath = "$::XCATROOT/share/xcat/install/windows"; + if ($os =~ /^hyperv/) { + $custmplpath = "$installroot/custom/install/hyperv"; + $tmplpath = "$::XCATROOT/share/xcat/install/hyperv"; + } + my $tmplfile=xCAT::SvrUtils::get_tmpl_file_name($custmplpath, $profile, $os, $arch); + if (! $tmplfile) { $tmplfile=xCAT::SvrUtils::get_tmpl_file_name($tmplpath, $profile, $os, $arch); } unless ( -r "$tmplfile") { $callback->( diff --git a/xCAT-server/share/xcat/install/windows/hypervisor.hyperv2012.x86_64.tmpl b/xCAT-server/share/xcat/install/hyperv/hypervisor.hyperv2012.x86_64.tmpl similarity index 100% rename from xCAT-server/share/xcat/install/windows/hypervisor.hyperv2012.x86_64.tmpl rename to xCAT-server/share/xcat/install/hyperv/hypervisor.hyperv2012.x86_64.tmpl diff --git a/xCAT-server/share/xcat/install/windows/hypervisor.hyperv2012.x86_64.tmpl.uefi b/xCAT-server/share/xcat/install/hyperv/hypervisor.hyperv2012.x86_64.tmpl.uefi similarity index 100% rename from xCAT-server/share/xcat/install/windows/hypervisor.hyperv2012.x86_64.tmpl.uefi rename to xCAT-server/share/xcat/install/hyperv/hypervisor.hyperv2012.x86_64.tmpl.uefi