fix(region): nutanix instance vcpu

This commit is contained in:
ioito
2022-01-25 14:45:53 +08:00
parent 992ca0d49d
commit 41fd940a44
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -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 {
+3 -3
View File
@@ -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