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

Extending the Disk #433

Open
BhargaviAllada opened this issue May 30, 2018 · 6 comments
Open

Extending the Disk #433

BhargaviAllada opened this issue May 30, 2018 · 6 comments
Labels
Type: Enhancement Adds new functionality.

Comments

@BhargaviAllada
Copy link

Versions:

  • Version of knife-vsphere: 2.0.1
  • Version of chef: 13.6.4

Platform Details

  • Version of vSphere: Version 6.5.0.10000 Build 7119157
  • Version of ESXi: 6.5.0

Scenario:

We are trying to extend the disk size.

Please paste the command and output (run with -VV). Don't forget to X out any passwords or sensitive information:

Command we used is below:
knife vsphere vm disk extend VM_Name 1000000 --folder Chef_Test --diskname "Hard disk 2" -VV

Output (run with -VV):
/root/.chefdk/gem/ruby/2.4.0/gems/rbvmomi-1.11.7/lib/rbvmomi/vim/Task.rb:14:in wait_for_completion': InvalidDeviceOperation: Invalid operation for device '0'. (RbVmomi::Fault) from /root/.chefdk/gem/ruby/2.4.0/gems/knife-vsphere-2.0.4/lib/chef/knife/vsphere_vm_disk_extend.rb:62:in run'
from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.6.4/lib/chef/knife.rb:442:in block in run_with_pretty_exceptions' from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.6.4/lib/chef/local_mode.rb:44:in with_server_connectivity'
from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.6.4/lib/chef/knife.rb:441:in run_with_pretty_exceptions' from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.6.4/lib/chef/knife.rb:219:in run'
from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.6.4/lib/chef/application/knife.rb:156:in run' from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.6.4/bin/knife:25:in <top (required)>'
from /bin/knife:255:in load' from /bin/knife:255:in

'

Expected Result:

We are trying to extend the existing VM disk size.

Actual Result:

We are getting the below error:
ERROR: RbVmomi::Fault: InvalidDeviceOperation: Invalid operation for device '0'.

@swalberg
Copy link
Collaborator

Hello! How big is the disk right now? The command expects the new disk size, in kilobytes. So 1000000 is trying to change the disk to 1 gigabyte, not grow it by one gig. If that ends up shrinking it, you get an error.

Let me know if that's the case, please.

@BhargaviAllada
Copy link
Author

Hi swalberg,

Thanks for you reply !
We were trying to shrink the size, So that might be the cause for the error. However it works fine when we are trying to extend the size with the greater value compared to the current size.

Is there any chance to give the disk value in MB or GB instead?

@swalberg
Copy link
Collaborator

Hi, I don't think you can shrink it through the API we're using. If I ever learn of a way to do that I'll put it on the backlog. I've got some concerns about the user experience so maybe putting it in a separate knife vsphere vm disk shrink command might be better.

Allowing it to accept human readable numbers like 100g or 200m is a great idea. Going to flag this as an enhancement.

@BhargaviAllada
Copy link
Author

Hi, Do we have a command to add the extra disk as well?

@BhargaviAllada
Copy link
Author

BhargaviAllada commented Jun 27, 2018 via email

@swalberg
Copy link
Collaborator

Discussion in #437.

@tas50 tas50 added Type: Enhancement Adds new functionality. and removed Enhancement labels Dec 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Adds new functionality.
Projects
None yet
Development

No branches or pull requests

3 participants