feature: emualated ssd support (#7701)

Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
This commit is contained in:
Jian Qiu
2020-09-01 10:49:37 +08:00
committed by GitHub
co-authored by Qiu Jian
parent 8ba3f86b55
commit 0cbad8aea3
4 changed files with 18 additions and 0 deletions
+8
View File
@@ -149,6 +149,7 @@ func init() {
AutoDelete string `help:"enable/disable auto delete of disk" choices:"enable|disable"`
AutoSnapshot string `help:"enable/disable auto snapshot of disk" choices:"enable|disable"`
DiskType string `help:"Disk type" choices:"data|volume"`
IsSsd *bool `help:"mark disk as ssd" negative:"no-is-ssd"`
}
R(&DiskUpdateOptions{}, "disk-update", "Update property of a virtual disk", func(s *mcclient.ClientSession, args *DiskUpdateOptions) error {
params := jsonutils.NewDict()
@@ -175,6 +176,13 @@ func init() {
if len(args.DiskType) > 0 {
params.Add(jsonutils.NewString(args.DiskType), "disk_type")
}
if args.IsSsd != nil {
if *args.IsSsd {
params.Add(jsonutils.JSONTrue, "is_ssd")
} else {
params.Add(jsonutils.JSONFalse, "is_ssd")
}
}
if params.Size() == 0 {
return InvalidUpdateError()
}