Old Script.

Adding README.md for basic QA.

WHATIS

This is very much intended for hybrid farms that use different types of virtualization servers.

Script for my own personal use.

Used to locate on which Virtualization Server a VM is currenlty running.

Works for:

  • HyperV
  • VSPHere
  • SCVMM (SystemCenterVirtualMachineManager)

For authentication if I recall correctly would try to use the current Windows User.

Files

Scripts are located inside the folder Testing.

Script to use:

  • with_middleware.ps1

The other ps1 files are older versions so they are not very relevant tbh.

Config files

Servers

On each file can (should) list the Virtualization Servers that will be used to authenticate on.

  • hyperv_list.txt
  • vsphere_list.txt
  • scvmm_list.txt

Desired VMs

List of VMs.

Very much a file on which you list the name of the VMs to locate.

  • hosts.txt

Syntax

Syntax for the txt files is very simple.

Items should be "splitted" through detecting whitespaces and new lines.

So if we have something like the following:

entry1 entry2
entry3

It should detect the following items:

  • entry1
  • entry2
  • entry3

How does it work.

  1. Loads files/values from the config files.
  2. Authenticates on all the servers you have listed with your windows user.
  3. Loads/Downloads all the VMs located on all the servers, yes, it takes a bit of time. Those items will be stored/kept on memory.
  4. Finds/locates form the list of "donloaded" vms, which server is hosting
  5. Returns the info in a simple 2-column-format (name | server).
  6. You can request more "VM locations". The VMs to find will be re-fetched from the host.txt file, so you can update such file, then request another location. Due the VM data from all the Virtualization Servers/Clusters been download/kept in memory, the responses will be fast.
Description
Script for my own personal use. Used to locate on which HyperV/VSphere Server a VM is located based off it's name.
Readme 129 KiB
Languages
PowerShell 100%