diff --git a/go.mod b/go.mod index f0c66d3965..fac1ce91f2 100644 --- a/go.mod +++ b/go.mod @@ -89,7 +89,7 @@ require ( k8s.io/cluster-bootstrap v0.19.3 k8s.io/cri-api v0.22.17 moul.io/http2curl/v2 v2.3.0 - yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240603072806-f376c3f1c8a1 + yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240604034108-b452a0501fee yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32 yunion.io/x/jsonutils v1.0.1-0.20240203102553-4096f103b401 yunion.io/x/log v1.0.1-0.20240305175729-7cf2d6cd5a91 diff --git a/go.sum b/go.sum index 9b558dd64f..e62a7edcb5 100644 --- a/go.sum +++ b/go.sum @@ -1215,8 +1215,8 @@ sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= -yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240603072806-f376c3f1c8a1 h1:xcovGMz5XbcbyLGEn9o7gkAiOLjugMwHaf7csu2fob8= -yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240603072806-f376c3f1c8a1/go.mod h1:quoJjGTJ2PjAY0+3YeN5JuN136whECKmfkJQwIsXKjM= +yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240604034108-b452a0501fee h1:Fkp5JJIMayFVF5W/qcLfzQ4n8BUuLOlFiMC6AZv4Z7o= +yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240604034108-b452a0501fee/go.mod h1:quoJjGTJ2PjAY0+3YeN5JuN136whECKmfkJQwIsXKjM= yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32 h1:v7POYkQwo1XzOxBoIoRVr/k0V9Y5JyjpshlIFa9raug= yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws= yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634= diff --git a/pkg/compute/models/hosts.go b/pkg/compute/models/hosts.go index 356ff0ad9d..be2c1ac55e 100644 --- a/pkg/compute/models/hosts.go +++ b/pkg/compute/models/hosts.go @@ -2015,6 +2015,9 @@ func (hh *SHost) SyncWithCloudHost(ctx context.Context, userCred mcclient.TokenC hh.IsBaremetal = true } hh.StorageInfo = extHost.GetStorageInfo() + if storageDriver := extHost.GetStorageDriver(); len(storageDriver) > 0 { + hh.StorageDriver = storageDriver + } hh.OvnVersion = extHost.GetOvnVersion() if cpuCmt := extHost.GetCpuCmtbound(); cpuCmt > 0 { @@ -2271,6 +2274,7 @@ func (manager *SHostManager) NewFromCloudHost(ctx context.Context, userCred mccl host.MemSize = extHost.GetMemSizeMB() host.StorageSize = extHost.GetStorageSizeMB() host.StorageType = extHost.GetStorageType() + host.StorageDriver = extHost.GetStorageDriver() host.CpuCmtbound = 8.0 if cpuCmt := extHost.GetCpuCmtbound(); cpuCmt > 0 { host.CpuCmtbound = cpuCmt diff --git a/pkg/mcclient/cloudpods/host.go b/pkg/mcclient/cloudpods/host.go index 2f657789a8..ab6e493ee1 100644 --- a/pkg/mcclient/cloudpods/host.go +++ b/pkg/mcclient/cloudpods/host.go @@ -157,6 +157,10 @@ func (host *SHost) GetStorageSizeMB() int64 { return host.StorageSize } +func (host *SHost) GetStorageDriver() string { + return host.StorageDriver +} + func (host *SHost) GetStorageInfo() jsonutils.JSONObject { return host.StorageInfo } diff --git a/vendor/modules.txt b/vendor/modules.txt index eddcbe1d24..23fa9e5ad0 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1489,7 +1489,7 @@ sigs.k8s.io/structured-merge-diff/v4/value # sigs.k8s.io/yaml v1.2.0 ## explicit; go 1.12 sigs.k8s.io/yaml -# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240603072806-f376c3f1c8a1 +# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240604034108-b452a0501fee ## explicit; go 1.18 yunion.io/x/cloudmux/pkg/apis yunion.io/x/cloudmux/pkg/apis/billing diff --git a/vendor/yunion.io/x/cloudmux/pkg/apis/compute/mongodb_const.go b/vendor/yunion.io/x/cloudmux/pkg/apis/compute/mongodb_const.go index 2537d874dd..cfd7d37e2b 100644 --- a/vendor/yunion.io/x/cloudmux/pkg/apis/compute/mongodb_const.go +++ b/vendor/yunion.io/x/cloudmux/pkg/apis/compute/mongodb_const.go @@ -17,6 +17,7 @@ package compute const ( MONGO_DB_STATUS_CREATING = "creating" MONGO_DB_STATUS_RUNNING = "running" + MONGO_DB_STATUS_PROCESSING = "processing" MONGO_DB_STATUS_DEPLOY = "deploy" MONGO_DB_STATUS_CHANGE_CONFIG = "change_config" MONGO_DB_STATUS_DELETING = "deleting" diff --git a/vendor/yunion.io/x/cloudmux/pkg/cloudprovider/resources.go b/vendor/yunion.io/x/cloudmux/pkg/cloudprovider/resources.go index 6bd3e661b1..bb2be526fb 100644 --- a/vendor/yunion.io/x/cloudmux/pkg/cloudprovider/resources.go +++ b/vendor/yunion.io/x/cloudmux/pkg/cloudprovider/resources.go @@ -306,6 +306,7 @@ type ICloudHost interface { GetStorageSizeMB() int64 GetStorageType() string GetHostType() string + GetStorageDriver() string GetStorageInfo() jsonutils.JSONObject GetIsMaintenance() bool diff --git a/vendor/yunion.io/x/cloudmux/pkg/multicloud/host_base.go b/vendor/yunion.io/x/cloudmux/pkg/multicloud/host_base.go index f078524bd7..c13c6fdf77 100644 --- a/vendor/yunion.io/x/cloudmux/pkg/multicloud/host_base.go +++ b/vendor/yunion.io/x/cloudmux/pkg/multicloud/host_base.go @@ -48,6 +48,10 @@ func (host *SHostBase) GetCpuArchitecture() string { return apis.OS_ARCH_X86_64 } +func (host *SHostBase) GetStorageDriver() string { + return "" +} + func (host *SHostBase) GetStorageInfo() jsonutils.JSONObject { return nil } diff --git a/vendor/yunion.io/x/cloudmux/pkg/multicloud/qcloud/mongodb.go b/vendor/yunion.io/x/cloudmux/pkg/multicloud/qcloud/mongodb.go index 86dda50aea..7e108f50fd 100644 --- a/vendor/yunion.io/x/cloudmux/pkg/multicloud/qcloud/mongodb.go +++ b/vendor/yunion.io/x/cloudmux/pkg/multicloud/qcloud/mongodb.go @@ -115,8 +115,10 @@ func (self *SMongoDB) GetName() string { func (self *SMongoDB) GetStatus() string { switch self.Status { - case 0, 1: + case 0: return api.MONGO_DB_STATUS_CREATING + case 1: + return api.MONGO_DB_STATUS_PROCESSING case 2: return api.MONGO_DB_STATUS_RUNNING case -2, -3: