Skip to content

Commit

Permalink
Merge pull request vmware#2807 from embano1/issue-2806
Browse files Browse the repository at this point in the history
  • Loading branch information
embano1 authored Apr 28, 2022
2 parents 7883035 + 11f2d45 commit be5528b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions govc/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5658,6 +5658,7 @@ Examples:
Options:
-disk.filePath= Disk file name
-disk.io.limit=<nil> Disk storage IO per seconds limit (-1 for unlimited)
-disk.key=0 Disk unique key
-disk.label= Disk label
-disk.name= Disk name
Expand Down
6 changes: 6 additions & 0 deletions govc/vm/disk/change.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ type change struct {

bytes units.ByteSize
mode string

// SIOC
limit *int64
}

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

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

editdisk.StorageIOAllocation.Limit = cmd.limit

switch backing := editdisk.Backing.(type) {
case *types.VirtualDiskFlatVer2BackingInfo:
backing.Sharing = cmd.sharing
Expand Down

0 comments on commit be5528b

Please sign in to comment.