diff --git a/pkg/hostman/hostdeployer/deployserver/deployserver.go b/pkg/hostman/hostdeployer/deployserver/deployserver.go index 7eaecf3818..443ad9bfdf 100644 --- a/pkg/hostman/hostdeployer/deployserver/deployserver.go +++ b/pkg/hostman/hostdeployer/deployserver/deployserver.go @@ -249,7 +249,13 @@ func (s *SDeployService) PrepareEnv() error { } if !winutils.CheckTool(DeployOption.ChntpwPath) { - log.Errorf("Failed to find chntpw tool") + if winutils.CheckTool("/usr/bin/chntpw.static") { + winutils.SetChntpwPath("/usr/bin/chntpw.static") + } else { + log.Errorf("Failed to find chntpw tool") + } + } else { + winutils.SetChntpwPath(DeployOption.ChntpwPath) } output, err = procutils.NewCommand("pvscan").Output() diff --git a/pkg/hostman/hostinfo/hostinfo.go b/pkg/hostman/hostinfo/hostinfo.go index e904e7cc66..5f120f9083 100644 --- a/pkg/hostman/hostinfo/hostinfo.go +++ b/pkg/hostman/hostinfo/hostinfo.go @@ -44,6 +44,7 @@ import ( "yunion.io/x/onecloud/pkg/hostman/storageman" "yunion.io/x/onecloud/pkg/hostman/system_service" "yunion.io/x/onecloud/pkg/mcclient" + "yunion.io/x/onecloud/pkg/mcclient/auth" "yunion.io/x/onecloud/pkg/mcclient/modules" "yunion.io/x/onecloud/pkg/util/cgrouputils" "yunion.io/x/onecloud/pkg/util/fileutils2" @@ -1364,6 +1365,9 @@ func (h *SHostInfo) unregister() { func (h *SHostInfo) OnCatalogChanged(catalog mcclient.KeystoneServiceCatalogV3) { // TODO: dynamic probe endpoint type defaultEndpointType := options.HostOptions.SessionEndpointType + if len(defaultEndpointType) == 0 { + defaultEndpointType = auth.PublicEndpointType + } if options.HostOptions.ManageNtpConfiguration { ntpd := system_service.GetService("ntpd") urls, _ := catalog.GetServiceURLs("ntp", options.HostOptions.Region, "", defaultEndpointType)