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

Skip all VM's that are in a specific folder ? #249

Open
mikefarace opened this issue Jun 16, 2018 · 5 comments
Open

Skip all VM's that are in a specific folder ? #249

mikefarace opened this issue Jun 16, 2018 · 5 comments

Comments

@mikefarace
Copy link

Hello,

We want to skip all VM's that are in a specific folder in Vsphere. We have a folder where archived and to be deleted VM's are put, which don't need to be monitored, and are already powered off.

We also have one ESXi test machine, that has a group of VMs on it that are only used for test migrations. We want to either exlude this ESXi host and all VMs on it, or exclude them only when they are powered off. I think just excluding them completely is fine. Is there a way to do this?

It seems there is python method to find VMs in a folder, so I was hopping there was a way in vpoller to identify a folder as being excluded.
https://stackoverflow.com/questions/37950968/how-to-find-vm-in-particular-folder-using-pyvmomi

@dnaeon
Copy link
Owner

dnaeon commented Jun 16, 2018

I’ll be happy to review a PR, but I don’t have time to implement that now.

You can already skip VMs by name pattern, so that’s an option as well.

@mikefarace
Copy link
Author

Is there a --properties option on vpoller-client that will show me the folder name? then I can just export the list of VMs and fold those that are in a particular folder, then add those VMs to the exclude line in the YAML file?

@dnaeon
Copy link
Owner

dnaeon commented Jun 21, 2018

There's no such feature in vPoller as of today. You might be able to get that by requesting all properties of the VMs, and filter the result based on the folder name, but that would be an expensive API call.

A better approach IMO would be to simply have a naming convention for VMs that are about to be archived - that way you can filter these VMs based on the naming convention.

@mikefarace
Copy link
Author

I am thinking now to have some external script run, maybe esxcli or something else can do it, to inventory the VMs and write to a file the list of VMs in the specific folder. Then add exclude those in the import / yaml file. Anyway, thats the best thing I can think of for now.

@ioshkin
Copy link

ioshkin commented Jan 19, 2021

There's no such feature in vPoller as of today. You might be able to get that by requesting all properties of the VMs, and filter the result based on the folder name, but that would be an expensive API call.

Hello. Are there any changes as for today in this question about folder name in properties?

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

No branches or pull requests

3 participants