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

Remove option for - knife vsphere vm vmdk add #449

Open
petericebear opened this issue Sep 10, 2018 · 5 comments
Open

Remove option for - knife vsphere vm vmdk add #449

petericebear opened this issue Sep 10, 2018 · 5 comments
Labels
Type: Enhancement Adds new functionality.

Comments

@petericebear
Copy link
Contributor

petericebear commented Sep 10, 2018

Platform Details

  • Version of vSphere: 5.5

Scenario:

Remove vmdk next to the add method functionality.

Hi,
Is it possible to create an opposite for adding a vmdk to a vm?
Like: knife vsphere vm vmdk remove XX

@petericebear
Copy link
Contributor Author

petericebear commented Sep 10, 2018

I see there is a reconfigeVM option: VirtualMachine.Config.RemoveDisk
But I do not see how to leverage that functionality.

When I do: $ knife vsphere vm disk list name-of-the-virtual-machine
The output is:
0 Hard disk 1 10.00 GiB
1 Hard disk 2 50.00 GiB
2 Hard disk 3 30.00 GiB

Hope that there is a way to remove disk number 1 or 2 9 (those where added with vmdk add).

@petericebear
Copy link
Contributor Author

@swalberg
Copy link
Collaborator

Hi Peter, we don't have such a command. Kinda surprising, really, seems like it would be helpful.

@petericebear
Copy link
Contributor Author

Yeah with that script it checks that you dont delete the primary disk (0), but all the others you can delete with:
knife vsphere vm disk remove vps-name 1

Where 1 is the disk index show with the disk list command.

@swalberg
Copy link
Collaborator

Oh, I didn't see you had a gist... that looks really good! Do you want to put it up as a PR?

Couple of small requests though: can you use SearchHelper to find the VM? See here and here. And instead of puts can you use ui.info, please?

@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