diff --git a/pkg/compute/models/guests.go b/pkg/compute/models/guests.go index e25b634abf..0e2f6c4887 100644 --- a/pkg/compute/models/guests.go +++ b/pkg/compute/models/guests.go @@ -5184,9 +5184,6 @@ func (self *SGuest) GetSpec(checkStatus bool) *jsonutils.JSONDict { gpuSpecs = append(gpuSpecs, *gs) } } - if gs := self.GetGpuSpec(); gs != nil { - gpuSpecs = append(gpuSpecs, *gs) - } spec.Set("gpu", jsonutils.Marshal(gpuSpecs)) return spec @@ -5283,6 +5280,10 @@ func (self *SGuest) GetShortDesc(ctx context.Context) *jsonutils.JSONDict { if len(self.InstanceType) > 0 { desc.Set("instance_type", jsonutils.NewString(self.InstanceType)) } + if gp := self.GetGpuSpec(); gp != nil { + desc.Set("gpu_model", jsonutils.NewString(gp.Model)) + desc.Set("gpu_count", jsonutils.NewString(gp.Amount)) + } address := jsonutils.NewString(strings.Join(self.GetRealIPs(), ",")) desc.Set("ip_addr", address)