Skip to content
Snippets Groups Projects
Commit 81992ba3 authored by Qiu Jian's avatar Qiu Jian
Browse files

add options to set disk driver and cachemode

parent 9492e3aa
No related branches found
No related tags found
No related merge requests found
......@@ -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"
......@@ -152,10 +153,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"`
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment