mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
add options to set disk driver and cachemode
This commit is contained in:
@@ -24,6 +24,7 @@ import (
|
||||
|
||||
api "yunion.io/x/onecloud/pkg/apis/compute"
|
||||
"yunion.io/x/onecloud/pkg/cloudcommon/db"
|
||||
"yunion.io/x/onecloud/pkg/compute/options"
|
||||
"yunion.io/x/onecloud/pkg/httperrors"
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/util/stringutils2"
|
||||
@@ -144,10 +145,10 @@ func (manager *SGuestdiskManager) FetchCustomizeColumns(
|
||||
func (self *SGuestdisk) DoSave(ctx context.Context, driver string, cache string, mountpoint string) error {
|
||||
self.ImagePath = ""
|
||||
if len(driver) == 0 {
|
||||
driver = "scsi"
|
||||
driver = options.Options.DefaultDiskDriver
|
||||
}
|
||||
if len(cache) == 0 {
|
||||
cache = "writeback"
|
||||
cache = options.Options.DefaultDiskCacheMode
|
||||
}
|
||||
if len(mountpoint) > 0 {
|
||||
self.Mountpoint = mountpoint
|
||||
|
||||
@@ -87,6 +87,9 @@ type ComputeOptions struct {
|
||||
DefaultHostQuota int `default:"500" help:"Common host quota per domain, default 500"`
|
||||
DefaultVpcQuota int `default:"500" help:"Common vpc quota per domain, default 500"`
|
||||
|
||||
DefaultDiskDriver string `help:"default disk driver" choices:"scsi|virtio|ide" default:"scsi"`
|
||||
DefaultDiskCacheMode string `help:"default kvm disk cache mode" choices:"writeback|none|writethrough" default:"writeback"`
|
||||
|
||||
SystemAdminQuotaCheck bool `help:"Enable quota check for system admin, default False" default:"false"`
|
||||
CloudaccountHealthStatusCheck bool `help:"Enable cloudaccount health status check, default True" default:"true"`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user