Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] vcsim: change VirtualDisk size decreases datastores freespace even if the size is same as before #2894

Closed
Syuparn opened this issue Jul 6, 2022 · 0 comments · Fixed by #2895

Comments

@Syuparn
Copy link
Contributor

Syuparn commented Jul 6, 2022

Describe the bug

Changing VirtualDisk size by ReconfigVM_Task decreases datastore's freespace even if the size is same as before.

To Reproduce

  1. run vcsim without any options
  2. check datatstore's freespace
  3. resize capacity of a disk (size is same as before)
  4. check datatstore's freespace again
# datastore freespace is 10,200GB
$ govc datastore.info
Name:        LocalDS_0
  Path:      /DC0/datastore/LocalDS_0
  Type:      OTHER
  URL:       /tmp/govcsim-DC0-LocalDS_0-1270584146
  Capacity:  10240.0 GB
  Free:      10200.0 GB

# disk size is 10GB
$ govc device.info -vm DC0_H0_VM0 disk-*
Name:           disk-202-0
  Type:         VirtualDisk
  Label:        disk-202-0
  Summary:      10,485,760 KB
  Key:          255511522
  Controller:   pvscsi-202
  Unit number:  0
  File:         [LocalDS_0] DC0_H0_VM0/disk1.vmdk

# change disk size to 10GB (= same size)
$ govc vm.disk.change -vm DC0_H0_VM0 -size 10G
$ govc datastore.info

Expected behavior
A clear and concise description of what you expected to happen.

Datastore has same freespace as before.

$ govc datastore.info
Name:        LocalDS_0
  Path:      /DC0/datastore/LocalDS_0
  Type:      OTHER
  URL:       /tmp/govcsim-DC0-LocalDS_0-1270584146
  Capacity:  10240.0 GB
  Free:      10200.0 GB

Affected version

  • vcsim 0.28.0

Screenshots/Debug Output

Datastore freespace decreases 10GB.

$ govc datastore.info
Name:        LocalDS_0
  Path:      /DC0/datastore/LocalDS_0
  Type:      OTHER
  URL:       /tmp/govcsim-DC0-LocalDS_0-1270584146
  Capacity:  10240.0 GB
  Free:      10190.0 GB

Additional context
Add any other context about the problem here.

Removing disk increases datastore freespace as expected.

$ govc datastore.info
Name:        LocalDS_0
  Path:      /DC0/datastore/LocalDS_0
  Type:      OTHER
  URL:       /tmp/govcsim-DC0-LocalDS_0-1270584146
  Capacity:  10240.0 GB
  Free:      10200.0 GB

$ govc vm.disk.create -vm DC0_H0_VM0 -name DC0_H0_VM0/disk2 -size 10G
[05-07-22 21:08:20] Creating disk

$ govc datastore.info
Name:        LocalDS_0
  Path:      /DC0/datastore/LocalDS_0
  Type:      OTHER
  URL:       /tmp/govcsim-DC0-LocalDS_0-1270584146
  Capacity:  10240.0 GB
  Free:      10190.0 GB

$ govc device.remove -vm DC0_H0_VM0 disk-202-1

$ govc datastore.info
Name:        LocalDS_0
  Path:      /DC0/datastore/LocalDS_0
  Type:      OTHER
  URL:       /tmp/govcsim-DC0-LocalDS_0-1270584146
  Capacity:  10240.0 GB
  Free:      10200.0 GB
@Syuparn Syuparn changed the title [BUG] vcsim: change VirtualDisk size decreases datastores capacity even if the size is same as before [BUG] vcsim: change VirtualDisk size decreases datastores freespace even if the size is same as before Jul 6, 2022
Syuparn added a commit to Syuparn/govmomi that referenced this issue Jul 6, 2022
Closes: vmware#2894
Signed-off-by: syuparn <s.hello.spagetti@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant