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

Issues filtering import #17

Open
krisdouglas opened this issue Apr 13, 2018 · 5 comments
Open

Issues filtering import #17

krisdouglas opened this issue Apr 13, 2018 · 5 comments

Comments

@krisdouglas
Copy link

Hello,

I am having issues using a filter rule on an import from a vSphere host. We essentially only want to import machines in a "poweredOn" state.

image

The way I've set it up to get this data is as such:

image

With no filter it goes to import all of the VMs, as you would expect. With the filter rule set to poweredOn, none of them sync.

If I run the sync it shows in the sync data that the vars.vm_powerstate is set appropriately for on/off machines.

Is this an issue we're witnessing or some err in my configuration?

@jaygopalu
Copy link

Hi,

I am having similar challenge. Have you setup a custom variable under the 'Data Fields' named 'vm_powerstate'? and what is the 'data type' you have used?

Jay

@jaygopalu
Copy link

For me "vmstate=running" condition worked.
I added a custom variable of type string named 'vmstate' & a sync rule to map ${guest.guestState} to vmstate.

@MrSqu1nty
Copy link

MrSqu1nty commented Apr 19, 2018

If I add an entry in the sync properties as below:
image

And then add a filter in the modify section as below:
image

Then I would expect it to show around 50+ changes that need to be made (to import those VMs), yet nothing changes at all.

@jaygopalu
Copy link

jaygopalu commented Apr 19, 2018

I do not see anything wrong in your configuration, have you verified 'Preview' section to confirm running state is being returned by your vCenter?

Also just a couple of differences when i compare it with my working setup.

  1. 'Merge Policy' i am using is 'replace',
  2. My filter is all in the lower case "vmstate=running".
  3. My 'Import source' has a 'Modifiers' rule as "guest.guestState->vmstate:Lowercase"

Try the modifier rule, re-import and check if it helps. Also verify your custom variable 'vmstate' and its 'Data type' as 'string'.

@kraba
Copy link

kraba commented Jun 20, 2018

Hi,
I had the same issue. I deleted all vsphere hosts, re-run import/sync Sync Rule and it works fine.
If you have import all vmware hosts at first import/sync Sync Rule, you must delete all manually (or the stopped ones) and after that re-run Sync Rule with filter.
Icinga/director don't delete host automatically (or...I do a wrong step).

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

4 participants