-
Notifications
You must be signed in to change notification settings - Fork 25
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
Microsoft Hyper-V host sync with IT Glue #8
base: master
Are you sure you want to change the base?
Conversation
Hi @ecspresso every time i try and run the script i am getting the following error and any assistance would be appreciated. Set-ITGlueFlexibleAssets : {"errors":[{"status":422,"title":"Unprocessable Entity","detail":"Request contains invalid trait keys","source":{"pointer":"data/attributes/traits"}}]}
|
I looked at all the trait keys in both files, I think the problem is Let me know it if works. |
Microsoft Hyper-V sync
This submission contains three scripts and one readme with instructions. The end result will sync the following to its asset in IT Glue:
The script will look for changes on the host compared to IT Glue and only update if a change is detected, there is also an option to manually force an update by setting "Force manual sync now" to "Yes". It will try to match each VM against a configuration in the organization where the VM Host flexible asset resides. IT will first try matching via name and then via MAC address. If the matching succeeds, a clickable link will be created in place of its name. If the matching fails, the name will be in plain text. It will also create a related item for each matched configuration (and remove it again if the VM is deleted from the host).
ITGlue-VMHost-CreateFlexibleAsset.ps1
This script will create a flexible asset type to hold the data. You will need to create a flexible asset for each server to sync.
ITGlue-VMHost-Setup.ps1
This script will prepare the environment on the server by (if not already saved) saving the API key and data center location via the wrapper module settings and creating a scheduled task to run the syncing script once every day.
ITGlue-VMHost-FeedFlexibleAssetHyperV.ps1
This is the script that will do the actual syncing. It will not run unless you have at least PowerShell version 3 and ITGlueAPI PowerShell wrapper version 2.0.7 installed. How to run the script is each to their own and it is possible to provide all the parameters inside the script file but there is no need to edit this script if following the provided instructions.
hyperv-related-items.txt
This file is created by
ITGlue-VMHost-FeedFlexibleAssetHyperV.ps1
. Because there is no endpoint to get related items and their IDs, the file is created to store the last reponse from the endpoint create related items. The data is imported the next time the script is run if found and all current VMs are matched aganst IT Glue and then compared aginst old related items. All configurations no longer on the host are removed.