diff --git a/pkg/apis/compute/guesttemplate.go b/pkg/apis/compute/guesttemplate.go index f55b247d55..af0063297d 100644 --- a/pkg/apis/compute/guesttemplate.go +++ b/pkg/apis/compute/guesttemplate.go @@ -57,6 +57,7 @@ type GuestTemplateDetails struct { Secgroups []string `json:"secgroups"` Zone string `json:"zone"` + ZoneId string `json:"zone_id"` Brand string `json:"brand"` ConfigInfo GuestTemplateConfigInfo `json:"config_info"` @@ -71,9 +72,6 @@ type GuestTemplateListInput struct { } type GuestTemplateConfigInfo struct { - Region string `json:"region"` - Zone string `json:"zone"` - Hypervisor string `json:"hypervisor"` Secgroup string `json:"secgroup"` Sku GuestTemplateSku `json:"sku"` Disks []GuestTemplateDisk `json:"disks"` diff --git a/pkg/compute/models/guest_template.go b/pkg/compute/models/guest_template.go index fc346e0c29..2aa6d2601c 100644 --- a/pkg/compute/models/guest_template.go +++ b/pkg/compute/models/guest_template.go @@ -345,23 +345,14 @@ func (gt *SGuestTemplate) getMoreDetails(ctx context.Context, userCred mcclient. return out, err } configInfo := computeapis.GuestTemplateConfigInfo{} - if len(input.PreferRegion) != 0 { - region := CloudregionManager.FetchRegionById(input.PreferRegion) - if region != nil { - input.PreferRegion = region.GetName() - } - configInfo.Region = input.PreferRegion - - } if len(input.PreferZone) != 0 { zone := ZoneManager.FetchZoneById(input.PreferZone) if zone != nil { input.PreferZone = zone.GetName() } + out.ZoneId = zone.GetId() out.Zone = input.PreferZone - configInfo.Zone = input.PreferZone } - configInfo.Hypervisor = gt.Hypervisor out.Brand = Hypervisor2Brand(gt.Hypervisor) // sku deal