Merge pull request #13345 from ioito/hotfix/qx-nutanix-disk

fix(region): nutanix disk
This commit is contained in:
Zexi Li
2022-01-27 12:25:28 +08:00
committed by GitHub
2 changed files with 14 additions and 1 deletions
+13
View File
@@ -16,8 +16,11 @@ package guestdrivers
import (
"context"
"fmt"
"time"
"yunion.io/x/pkg/utils"
api "yunion.io/x/onecloud/pkg/apis/compute"
"yunion.io/x/onecloud/pkg/cloudcommon/db/quotas"
"yunion.io/x/onecloud/pkg/cloudcommon/db/taskman"
@@ -144,6 +147,16 @@ func (self *SNutanixGuestDriver) GetDeployStatus() ([]string, error) {
return []string{api.VM_READY}, nil
}
func (self *SNutanixGuestDriver) ValidateResizeDisk(guest *models.SGuest, disk *models.SDisk, storage *models.SStorage) error {
if !utils.IsInStringArray(guest.Status, []string{api.VM_READY}) {
return fmt.Errorf("Cannot resize disk when guest in status %s", guest.Status)
}
if disk.DiskSize/1024%1 > 0 {
return fmt.Errorf("Resize disk size must be an integer multiple of 1G")
}
return nil
}
func (self *SNutanixGuestDriver) ValidateCreateEip(ctx context.Context, userCred mcclient.TokenCredential, input api.ServerCreateEipInput) error {
return httperrors.NewInputParameterError("%s not support create eip", self.GetHypervisor())
}
+1 -1
View File
@@ -299,7 +299,7 @@ func (self *SHost) CreateVM(opts *cloudprovider.SManagedVMCreateConfig) (cloudpr
"disk_address": map[string]string{
"vmdisk_uuid": image.VMDiskID,
},
"minimum_size": image.VMDiskSize,
"minimum_size": opts.SysDisk.SizeGB * 1024 * 1024 * 1024,
},
},
}