Skip to content

Commit 11f2d45

Browse files
author
Michael Gasch
committed
govc: Edit disk storage IO
Closes: #2806 Signed-off-by: Michael Gasch <[email protected]>
1 parent 6caaafa commit 11f2d45

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

govc/USAGE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5658,6 +5658,7 @@ Examples:
56585658
56595659
Options:
56605660
-disk.filePath= Disk file name
5661+
-disk.io.limit=<nil> Disk storage IO per seconds limit (-1 for unlimited)
56615662
-disk.key=0 Disk unique key
56625663
-disk.label= Disk label
56635664
-disk.name= Disk name

govc/vm/disk/change.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ type change struct {
4141

4242
bytes units.ByteSize
4343
mode string
44+
45+
// SIOC
46+
limit *int64
4447
}
4548

4649
func init() {
@@ -73,6 +76,7 @@ func (cmd *change) Register(ctx context.Context, f *flag.FlagSet) {
7376
f.IntVar(&cmd.key, "disk.key", 0, "Disk unique key")
7477
f.StringVar(&cmd.mode, "mode", "", fmt.Sprintf("Disk mode (%s)", strings.Join(vdmTypes, "|")))
7578
f.StringVar(&cmd.sharing, "sharing", "", fmt.Sprintf("Sharing (%s)", strings.Join(sharing, "|")))
79+
f.Var(flags.NewOptionalInt64(&cmd.limit), "disk.io.limit", "Disk storage IO per seconds limit (-1 for unlimited)")
7680
}
7781

7882
func (cmd *change) Process(ctx context.Context) error {
@@ -152,6 +156,8 @@ func (cmd *change) Run(ctx context.Context, f *flag.FlagSet) error {
152156
editdisk.CapacityInKB = int64(cmd.bytes) / 1024
153157
}
154158

159+
editdisk.StorageIOAllocation.Limit = cmd.limit
160+
155161
switch backing := editdisk.Backing.(type) {
156162
case *types.VirtualDiskFlatVer2BackingInfo:
157163
backing.Sharing = cmd.sharing

0 commit comments

Comments
 (0)