VMware vSphere

From Hornbill
Revision as of 12:36, 29 April 2020 by Rickyf (talk | contribs)
Jump to navigation Jump to search
Home > Administration > IT Operations Management > ITOM Package Library > VMWare vSphere Index

Vmware logo.png

Introduction

The VMware vSphere package for Hornbill's IT Operations Management (ITOM) contains administrative operations that allows you to manage vSphere Virtual Machines.

Related Articles

Target Environment Requirements

Script Execution Machine Requirements

  • The target machine should be running PowerShell 5.1;
  • The VMware.PowerCLI PowerShell module needs to exist on the machine that will be executing the scripts;
  • If the script execution policy on the machine is "Restricted", then this will need to be updated to something less restrictive. See the PowerShell Documentation for more information.

KeySafe Configuration

Itomtarget keysafe.png
Vmware keysafe.png

When creating SIS jobs for operations contained within this package, they need to be run on the target machine as a user who has the correct privileges within your environment and will require an additional KeySafe Key to hold the account credentials to connect to VMware vSphere.

To configure your Target Machine account authentication in KeySafe:

  • In the Admin console, navigate to: System > Security > KeySafe;
  • Click on + then select Username + Password;
  • Give the KeySafe Key a Title (this is the name/identifier for the target machine account as you will see it when creating an IT Automation Job, or adding an IT Automation node to a Business Process or Runbook);
  • Optionally add a description;
  • Populate the Username field with the domain/local account username for the account used on the target machine;
  • Populate the Password field with the password for the above account;
  • Select Create Key to save.

To configure your VMware vSphere account authentication in KeySafe:

  • In the Admin console, navigate to: System > Security > KeySafe;
  • In the Type field, select Username + Password
  • Give the API Key a title (this is the name/identifier for the VMware vSphere account as you will see it when using the Integration Call node in your business process);
  • Optionally add a description;
  • Username - this should be populated with the Username of the user to run the operations as;
  • Password - this should be populated with the password for the above account;
  • API Endpoint - this should be populated with the hostname of your VMware host that you wish to target;
  • Click Create Key to save.

See screenshots to the right for examples.

Package Operations

Vmware job.png

The VMware vSphere package contains the following operations, than can be used to create ITOM Jobs directly, or included in your Business Processes and/or IT Operations Management Runbooks.

Start VM

This operation will Start a VMware vSphere Virtual Machine.

Extra Credentials

None required.

Input Parameters

  • VMName (MANDATORY) - The name of the Virtual Machine to perform the action against. Supports the * wildcard to perform the action against multiple VMs;
  • Port - Specifies the port on the server you want to use for the connection;
  • Protocol - Specifies the internet protocol you want to use for the connection. It can be either http or https;
  • NoTrustedCert - Specifies if the Connect-VIServer cmdlet will establish the connection without taking into account that the certificate is invalid.

Output Parameters

  • errors - Any errors returned by the operation;
  • outcome - Outcome of the operation. Can be OK or FAIL;
  • warnings - Any warnings returned by the operation.

Stop VM

This operation will power-off a VMware vSphere Virtual Machine.

Extra Credentials

None required.

Input Parameters

  • VMName (MANDATORY) - The name of the Virtual Machine to perform the action against. Supports the * wildcard to perform the action against multiple VMs;
  • Port - Specifies the port on the server you want to use for the connection;
  • Protocol - Specifies the internet protocol you want to use for the connection. It can be either http or https;
  • NoTrustedCert - Specifies if the Connect-VIServer cmdlet will establish the connection without taking into account that the certificate is invalid;
  • Kill - Indicates that you want to stop the specified virtual machines by terminating their processes running on the ESX. You can use this parameter to stop a virtual machine that is not responding and cannot be stopped or restarted in other ways.

Output Parameters

  • errors - Any errors returned by the operation
  • outcome - Outcome of the operation. Can be OK or FAIL
  • warnings - Any warnings returned by the operation

Suspend VM

This operation will Suspend a VMware vSphere Virtual Machine.

Extra Credentials

None required.

Input Parameters

  • VMName (MANDATORY) - The name of the Virtual Machine to perform the action against. Supports the * wildcard to perform the action against multiple VMs;
  • Port - Specifies the port on the server you want to use for the connection;
  • Protocol - Specifies the internet protocol you want to use for the connection. It can be either http or https;
  • NoTrustedCert - Specifies if the Connect-VIServer cmdlet will establish the connection without taking into account that the certificate is invalid.

Output Parameters

  • errors - Any errors returned by the operation;
  • outcome - Outcome of the operation. Can be OK or FAIL;
  • warnings - Any warnings returned by the operation.

Restart VM

This operation will Restart a VMware vSphere Virtual Machine.

Extra Credentials

None required.

Input Parameters

  • VMName (MANDATORY) - The name of the Virtual Machine to perform the action against. Supports the * wildcard to perform the action against multiple VMs;
  • Port - Specifies the port on the server you want to use for the connection;
  • Protocol - Specifies the internet protocol you want to use for the connection. It can be either http or https;
  • NoTrustedCert - Specifies if the Connect-VIServer cmdlet will establish the connection without taking into account that the certificate is invalid.

Output Parameters

  • errors - Any errors returned by the operation;
  • outcome - Outcome of the operation. Can be OK or FAIL;
  • warnings - Any warnings returned by the operation.

Restart VM Guest

This operation will restart the guest OS on a VMware vSphere Virtual Machine.

Extra Credentials

None required.

Input Parameters

  • VMName (MANDATORY) - The name of the Virtual Machine to perform the action against. Supports the * wildcard to perform the action against multiple VMs;
  • Port - Specifies the port on the server you want to use for the connection;
  • Protocol - Specifies the internet protocol you want to use for the connection. It can be either http or https;
  • NoTrustedCert - Specifies if the Connect-VIServer cmdlet will establish the connection without taking into account that the certificate is invalid.

Output Parameters

  • errors - Any errors returned by the operation;
  • outcome - Outcome of the operation. Can be OK or FAIL;
  • warnings - Any warnings returned by the operation.

New Snapshot

This operation will take a snapshot of a VMware vSphere Virtual Machine.

Extra Credentials

None required.

Input Parameters

  • VMName (MANDATORY) - The name of the Virtual Machine to perform the action against. Supports the * wildcard to perform the action against multiple VMs;
  • Port - Specifies the port on the server you want to use for the connection;
  • Protocol - Specifies the internet protocol you want to use for the connection. It can be either http or https;
  • NoTrustedCert - Specifies if the Connect-VIServer cmdlet will establish the connection without taking into account that the certificate is invalid;
  • SnapshotName - Specifies the name of the new snapshot;
  • Description - Specifies a description against the new snapshot;
  • Memory - Specifies if the virtual machine's memory state is to be preserved with the snapshot;
  • Quiesce - Specifies if VMware Tools is to attempt to quiesce the file system of the virtual machine. This assures that a disk snapshot represents a consistent state of the guest file systems. If the virutal machine is powered off or VMware Tools are not available, the Quiesce parameter is ignored.

Output Parameters

  • errors - Any errors returned by the operation;
  • outcome - Outcome of the operation. Can be OK or FAIL;
  • warnings - Any warnings returned by the operation;
  • snapshotId - The ID of the new snapshot.

Remove VM Snapshot

This operation will remove a snapshot from a VMware vSphere Virtual Machine.

Extra Credentials

None required.

Input Parameters

  • VMName (MANDATORY) - The name of the Virtual Machine to perform the action against. Supports the * wildcard to perform the action against multiple VMs;
  • Port - Specifies the port on the server you want to use for the connection;
  • Protocol - Specifies the internet protocol you want to use for the connection. It can be either http or https;
  • NoTrustedCert - Specifies if the Connect-VIServer cmdlet will establish the connection without taking into account that the certificate is invalid;
  • SnapshotID - Specifies the ID of the snapshot to remove. You can provide this OR SnapshotName;
  • SnapshotName - Specifies the name of the snapshot to remove. You can provide this OR SnapshotID;
  • RemoveChildren - Indicates that you want to remove the children of the specified snapshots as well.

NOTE if values are provided for both SnapshotID and SnapshotName, then the value of SnapshotID will take precedence.

Output Parameters

  • errors - Any errors returned by the operation;
  • outcome - Outcome of the operation. Can be OK or FAIL;
  • warnings - Any warnings returned by the operation.

Amend vCPU Count

This operation will amend the number of vCPUs for a VMware vSphere Virtual Machine.

Extra Credentials

None required.

Input Parameters

  • VMName (MANDATORY) - The name of the Virtual Machine to perform the action against. Supports the * wildcard to perform the action against multiple VMs;
  • Port - Specifies the port on the server you want to use for the connection;
  • Protocol - Specifies the internet protocol you want to use for the connection. It can be either http or https;
  • NoTrustedCert - Specifies if the Connect-VIServer cmdlet will establish the connection without taking into account that the certificate is invalid;
  • AmendBy (MANDATORY) - Specifies the number of vCPUs to amend the count by - supports either a positive (2 for example) or negative (-2 for example) integer.

Output Parameters

  • errors - Any errors returned by the operation;
  • outcome - Outcome of the operation. Can be OK or FAIL;
  • warnings - Any warnings returned by the operation;
  • oldTotal - The number of vCPUs before the operation was run;
  • newTotal - The number of vCPUs after the operation was run.

Amend RAM Total

This operation will amend the number of vCPUs for a VMware vSphere Virtual Machine.

Extra Credentials

None required.

Input Parameters

  • VMName (MANDATORY) - The name of the Virtual Machine to perform the action against. Supports the * wildcard to perform the action against multiple VMs;
  • Port - Specifies the port on the server you want to use for the connection;
  • Protocol - Specifies the internet protocol you want to use for the connection. It can be either http or https;
  • NoTrustedCert - Specifies if the Connect-VIServer cmdlet will establish the connection without taking into account that the certificate is invalid;
  • AmendBy (MANDATORY) - Specifies the amount of RAM (GB) to amend the total by - supports either a positive (2 for example) or negative (-0.5 for example) double.

Output Parameters

  • errors - Any errors returned by the operation;
  • outcome - Outcome of the operation. Can be OK or FAIL;
  • warnings - Any warnings returned by the operation;
  • oldTotal - The amount of RAM before the operation was run;
  • newTotal - The amount of RAM after the operation was run.

Add HDD

This operation will add a virtual hard disk to a VMware vSphere Virtual Machine. See the New-HardDisk PowerShell cmdlet documentation for detailed information regarding the operation-specific input and output parameters.

Extra Credentials

None required.

Input Parameters

  • VMName (MANDATORY) - The name of the Virtual Machine to perform the action against. Supports the * wildcard to perform the action against multiple VMs;
  • Port - Specifies the port on the server you want to use for the connection;
  • Protocol - Specifies the internet protocol you want to use for the connection. It can be either http or https;
  • NoTrustedCert - Specifies if the Connect-VIServer cmdlet will establish the connection without taking into account that the certificate is invalid;
  • CapacityGB - Specifies the size (GB) of the new HDD;
  • Persistence - Specifies the disk persistence mode. The valid values are Persistent, IndependentPersistent, and IndependentNonPersistent. This parameter is supported only when the DiskType is set to "rawVirtual" or "flat";
  • DiskType - Specifies the type of file backing that you want to use. The valid values are rawVirtual, rawPhysical, flat, and unknown;
  • DeviceName - Specifies the host-specific device the Logical Unit Number (LUN) is being accessed through;
  • DiskPath - Specifies the path to the hard disk;
  • StorageFormat - Specifies the storage format of the new hard disk. This parameter accepts Thin, Thick, and EagerZeroedThick values;
  • StoragePolicy - Specifies the storage policy that you want to attach to the new disk. If the storage policy is an encryption policy, the new disk will be encrypted. If the storage policy is a non-encryption policy, the policy will be attached to the new disk.

Output Parameters

  • errors - Any errors returned by the operation;
  • outcome - Outcome of the operation. Can be OK or FAIL;
  • warnings - Any warnings returned by the operation;
  • storageFormat
  • persistence
  • diskType
  • filename
  • capacityGB
  • parentId
  • uid
  • id
  • name

Add Network Adapter

This operation will add a virtual network adapter to a VMware vSphere Virtual Machine. See the New-NetworkAdapter PowerShell cmdlet documentation for detailed information regarding the operation-specific input and output parameters.

Extra Credentials

None required.

Input Parameters

  • VMName (MANDATORY) - The name of the Virtual Machine to perform the action against. Supports the * wildcard to perform the action against multiple VMs;
  • Port - Specifies the port on the server you want to use for the connection;
  • Protocol - Specifies the internet protocol you want to use for the connection. It can be either http or https;
  • NoTrustedCert - Specifies if the Connect-VIServer cmdlet will establish the connection without taking into account that the certificate is invalid;
  • NetworkName (MANDATORY) - Specifies the name of the network to which you want to add the new virtual network adapter;
  • MacAddress - Specifies an optional MAC address for the new virtual network adapter;
  • PhysicalFunction - Specifies the PCI ID of the physical device, backing a SriovEthernetCard adapter. If omitted, automatic mode is used for the physical function;
  • StartConnected - Indicates that the virtual network adapter starts connected when the virtual machine associated with it powers on;
  • Type - Specifies the type of the new network adapter. The valid types are e1000, Flexible, Vmxnet, EnhancedVmxnet, Vmxnet3, SriovEthernetCard, Vmxnet3Vrdma, and Unknown. If no value is given to the parameter, the new network adapter is of the type recommended by VMware for the given guest OS;
  • WakeOnLan - Indicates that wake-on-LAN is enabled on the newly created virtual network adapter.

Output Parameters

  • errors - Any errors returned by the operation;
  • outcome - Outcome of the operation. Can be OK or FAIL;
  • warnings - Any warnings returned by the operation;
  • macAddress
  • wakeOnLanEnabled
  • type
  • parentId
  • uid
  • id
  • name

Move VM

This operation will VMware vSphere Virtual Machine to another folder, host, cluster or resource pool.

Extra Credentials

None required.

Input Parameters

  • VMName (MANDATORY) - The name of the Virtual Machine to perform the action against. Supports the * wildcard to perform the action against multiple VMs;
  • Port - Specifies the port on the server you want to use for the connection;
  • Protocol - Specifies the internet protocol you want to use for the connection. It can be either http or https;
  • NoTrustedCert - Specifies if the Connect-VIServer cmdlet will establish the connection without taking into account that the certificate is invalid;
  • VIContainer (MANDATORY) - Specify the resource pool/folder/host/cluster where you want to move the virtual machine to;
  • VMotionPriority - The priority that should be used for a vMotion operartion - Standard or High.

NOTE if values are provided for both SnapshotID and SnapshotName, then the value of SnapshotID will take precedence.

Output Parameters

  • errors - Any errors returned by the operation;
  • outcome - Outcome of the operation. Can be OK or FAIL;
  • warnings - Any warnings returned by the operation.