Virus Scan All Managed DiskLast Updated December 16, 2024
Suppose you want to run the antivirus software presented in Scan VMDK for Virus Signatures for all virtual machines hosted on an ESXi host. Here is the high-level algorithm for a VMware vSphere solution that can scan managed disk on all virtual machines.
To virus scan managed virtual disk:
- Using the VMware vSphere Perl Toolkit, write a Perl script that connects to a given ESXi host.
- CallVim::find_entity_views()to find the inventory of everyVirtualMachine.
- CallVim::get_inventory_path()to get the virtual disk name in its appropriate resource.The VMDK filename is available asdiskPathin theGuestDiskInfodata object.
- Using Perl’ssystem(@cmd)call, run the extendedvixDiskLibSample.exeprogram with-virusoption.For ESXi hosts you must specify-host,-user, and-passwordoptions.
- Decontaminate any infected sectors that the virus scanner located.