mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix(region): nutanix instance vcpu
This commit is contained in:
@@ -334,7 +334,7 @@ func (self *SInstance) GetVNCInfo(input *cloudprovider.ServerVncInput) (*cloudpr
|
||||
}
|
||||
|
||||
func (self *SInstance) GetVcpuCount() int {
|
||||
return self.NumVcpus * self.NumVcpus
|
||||
return self.NumCoresPerVcpu * self.NumVcpus
|
||||
}
|
||||
|
||||
func (self *SInstance) GetVmemSizeMB() int {
|
||||
|
||||
@@ -237,7 +237,7 @@ func (self *SNutanixClient) wait(taskId string) (string, error) {
|
||||
func (self *SNutanixClient) update(res, id string, body jsonutils.JSONObject, retVal interface{}) error {
|
||||
resp, err := self._update(res, id, body)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "update %s/%s", res, id)
|
||||
return errors.Wrapf(err, "update %s/%s %v", res, id, body)
|
||||
}
|
||||
task := struct {
|
||||
TaskUUID string
|
||||
@@ -258,7 +258,7 @@ func (self *SNutanixClient) update(res, id string, body jsonutils.JSONObject, re
|
||||
func (self *SNutanixClient) post(res string, body jsonutils.JSONObject, retVal interface{}) error {
|
||||
resp, err := self._post(res, body)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "post %s", res)
|
||||
return errors.Wrapf(err, "post %s %v", res, body)
|
||||
}
|
||||
if retVal != nil {
|
||||
if resp.Contains("entities") {
|
||||
@@ -355,7 +355,7 @@ func (self *sNutanixError) ParseErrorFromJsonResponse(statusCode int, body jsonu
|
||||
|
||||
func _jsonRequest(cli *http.Client, method httputils.THttpMethod, url string, header http.Header, body jsonutils.JSONObject, debug bool) (jsonutils.JSONObject, error) {
|
||||
client := httputils.NewJsonClient(cli)
|
||||
req := httputils.NewJsonRequest(method, url, nil)
|
||||
req := httputils.NewJsonRequest(method, url, body)
|
||||
ne := &sNutanixError{}
|
||||
_, resp, err := client.Send(context.Background(), req, ne, debug)
|
||||
return resp, err
|
||||
|
||||
Reference in New Issue
Block a user