diff --git a/pkg/cloudcommon/db/opslog.go b/pkg/cloudcommon/db/opslog.go index 18c55604fb..cb2ac61796 100644 --- a/pkg/cloudcommon/db/opslog.go +++ b/pkg/cloudcommon/db/opslog.go @@ -175,7 +175,7 @@ type SOpsLog struct { ObjType string `width:"40" charset:"ascii" nullable:"false" list:"user"` // = Column(VARCHAR(40, charset='ascii'), nullable=False) ObjId string `width:"128" charset:"ascii" nullable:"false" list:"user"` // = Column(VARCHAR(ID_LENGTH, charset='ascii'), nullable=False) ObjName string `width:"128" charset:"utf8" nullable:"false" list:"user"` //= Column(VARCHAR(128, charset='utf8'), nullable=False) - Action string `width:"32" charset:"ascii" nullable:"false" list:"user"` //= Column(VARCHAR(32, charset='ascii'), nullable=False) + Action string `width:"32" charset:"utf8" nullable:"false" list:"user"` //= Column(VARCHAR(32, charset='ascii'), nullable=False) Notes string `width:"2048" charset:"utf8" list:"user"` // = Column(VARCHAR(2048, charset='utf8')) ProjectId string `name:"tenant_id" width:"128" charset:"ascii" list:"user"` // = Column(VARCHAR(ID_LENGTH, charset='ascii')) Project string `name:"tenant" width:"128" charset:"utf8" list:"user"` // tenant = Column(VARCHAR(128, charset='utf8')) diff --git a/pkg/compute/hostdrivers/kvm.go b/pkg/compute/hostdrivers/kvm.go index fb028d7705..28ded7f381 100644 --- a/pkg/compute/hostdrivers/kvm.go +++ b/pkg/compute/hostdrivers/kvm.go @@ -310,9 +310,23 @@ func (self *SKVMHostDriver) PrepareConvert(host *models.SHost, image, raid strin if err != nil { return nil, err } + portStr := authLoc.Port() + useSsl := "" + if authLoc.Scheme == "https" { + useSsl = "yes" + if len(portStr) == 0 { + portStr = "443" + } + } else { + if len(portStr) == 0 { + portStr = "80" + } + } authInfo := fmt.Sprintf("YUNION_REGION=%s\n", options.Options.Region) authInfo += fmt.Sprintf("YUNION_KEYSTONE=%s\n", options.Options.AuthURL) authInfo += fmt.Sprintf("YUNION_KEYSTONE_HOST=%s\n", authLoc.Hostname()) + authInfo += fmt.Sprintf("YUNION_KEYSTONE_PORT=%s\n", portStr) + authInfo += fmt.Sprintf("YUNION_KEYSTONE_USE_SSL=%s\n", useSsl) authInfo += fmt.Sprintf("YUNION_HOST_NAME=%s\n", host.GetName()) authInfo += fmt.Sprintf("YUNION_HOST_ADMIN=%s\n", options.Options.AdminUser) authInfo += fmt.Sprintf("YUNION_HOST_PASSWORD=%s\n", options.Options.AdminPassword)