mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix(region): nutanix disk
This commit is contained in:
@@ -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())
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user