Igiko offers the capability to execute PowerShell callbacks when creating, editing, or deleting Virtual Machines (VMs). To utilize this feature, follow these steps:
Step-by-step Guide
Create a directory named Callbacks inside the ProgramData -> Igiko folder.
Within this directory, create the necessary script files for handling VM actions. Name them as follows:
OnCreateVm.ps1
OnUpdateVm.ps1
OnDeleteVm.ps1
Each script file should include a parameter for vm_id, which represents the ID of the VM being created, updated, or deleted.
Example Script
Here is a sample script for use when creating a VM:
param(
[System.Guid]$vm_id
)
Get-VM -Id $vm_id | Set-VM -Notes "Created"
By using this approach, you can perform advanced VM configurations necessary for properly setting up a VM in a virtual environment. This includes, for example, configuring network settings such as VLANs or ACL rules.