5.4.7 Delete a virtual server
Function
This component deletes a virtual server in the Hyper-V environment.
When deleting a virtual server from the Hyper-V server, the component also deletes the snapshot.
If "yes" was selected in the hyperv.vHardDiskDeletePermanently property, all virtual disk files (adjustable size, fixed size, and differential) assigned to the selected virtual server will be deleted. Disks and files assigned to the pass-through (physical) disks, floppy disks, CDs, DVDs and other sources are not deleted. If a virtual disk (differential) is assigned, the virtual disk used as the parent (base) of the virtual disk (differential) is not deleted.
If the hyperv.vhdListOutputFileName property was specified, a list of paths of the virtual disk files assigned to the virtual server that will be deleted from the Hyper-V server is output in CSV format. If a virtual disk (differential) is assigned, the virtual disk used as the parent of the virtual disk (differential) is not included.
The items in the output CSV file are shown below.
The items are separated by commas in the output file.
(a) Existence of virtual disk files (Header name: Existence)
This outputs whether the assigned virtual disk files exist when deleting a virtual server. The values of the items are shown below.
Found: Existence of file was confirmed.
NotFound: A file was set, but could not be found.
(b) File deletion result (Header name: DeleteResult)
If "yes" was selected in the hyperv.vHardDiskDeletePermanently property, the deletion execution result for the virtual disk files is output. If "no" was selected, "Skipped" is output. The values of the items are shown below.
Completed: File deletion was successful.
Failed: File deletion failed.
Skipped: File deletion was not performed.
(c) File path (Header name: FilePath)
Regardless of the content of (a) and (b), the path is output for the virtual disk files that were set in the Hyper-V server.
The following servers are required for this component:
- Hyper-V server (Execution target server)
This is the server where Hyper-V is installed.
- Virtual server
This is a virtual server managed by Hyper-V.
Use situation
This component can be used to delete a virtual server: for example when eliminating virtual servers.
Prerequisites
For the latest support information about [Required product in the System]/[Required products on the execution target server]/[Prerequisite product OS running in the execution target server], see the release notes.
[Required product in the System]
JP1/Automatic Operation 11-00 or later
[Required products on the execution target server]
(1)Prerequisite product of Hyper-V Server
- Windows Server 2008 R2 Hyper-V
(2)Prerequisite OS running in the virtual servers
- Windows Server 2008 R2 Standard/Enterprise/Datacenter
This does not apply to Server Core installation environments.
[Prerequisite product OS running in the execution target server]
- Windows Server 2008 R2 Standard/Enterprise/Datacenter
This does not apply to Server Core installation environments.
[Usage conditions for required products on the execution target server]
(1) The virtual server name must be unique within the Hyper-V server.
(2) The virtual server must be in a completely stopped state.
Cautions
(1) If an operation (such as a snapshot operation) was performed where the path of the virtual disk file cannot be referenced from the virtual server setting information, the virtual disk files are not deleted. In this case, delete them manually.
(2) If the file whose name is set in the hyperv.vhdListOutputFileName property already exists, the existing file is overwritten.
(3) If a folder with the path specified at the hyperv.vhdListOutputFileName property does not exist, the folder is created. The created folder remains and is not deleted. Delete unused folders on a regular basis.
(4) If hyperv.vhdListOutputFileName property is specified, the list of the virtual disk files is output even if an error occurs when the virtual server or the virtual disk file is deleted.
(5) This component does not delete the registration information of the virtual server from the service and application of the failover cluster manager. Manually delete this information based on user operations.
Version
02.00.00
Plug-in tags
Delete VM,Hyper-V 2008
Plug-in name displayed in the task log
hypervDeleteVM
Return code
0: Normal
12: Error (Mistake by user) A property is invalid.
23: Error (Invalid environment) The environment requirements are not met.
27: Error (Check the task log for error details.)
41: Error (An error was detected in the component.) A property was not entered. (An error was detected in the component script.)
Property list
The following table lists the properties:
Property key |
Property name |
Description |
Default value |
I/O type |
Required |
---|---|---|---|---|---|
plugin.destinationHost |
Host name of the execution target server |
Specify the host name or IP address of the server on which this plugin will be executed. IPv6 addresses are not supported. |
-- |
Input |
R |
hyperv.vmName |
Virtual server name |
Specifies the name of the virtual server. (This is the name of the virtual server as it is displayed in Hyper-V. This is not the host name in the OS.) |
-- |
Input |
R |
hyperv.vHardDiskDeletePermanently |
Deletion of virtual disk file required |
Specifies whether to delete virtual disk file used for the virtual server. |
no |
Input |
R |
hyperv.vhdListOutputFileName |
Output file name for virtual disk file list |
Specifies, as a full path, the file name for the output of the virtual disk file list. |
-- |
Input |
O |
hyperv.checkJobDelVMCount |
Job monitoring count (DestroyVirtualSystem method) |
This property adjusts the job monitoring count for monitoring requests to Hyper-V for processing (DestroyVirtualSystem method). You do not need to change the value of this property. |
28800 |
Input |
R |
hyperv.checkJobDelVMInterval |
Monitor interval (DestroyVirtualSystem method) |
This property adjusts the job monitoring interval for monitoring requests to Hyper-V for processing (DestroyVirtualSystem method). You do not need to change the value of this property. |
3 |
Input |
R |
hyperv.checkJobDelSnapshotCount |
Job monitoring count (RemoveVirtualSystemSnapshotTree method) |
This property adjusts the job monitoring count for monitoring requests to Hyper-V for processing (RemoveVirtualSystemSnapshotTree method). You do not need to change the value of this property. |
28800 |
Input |
R |
hyperv.checkJobDelSnapshotInterval |
Monitor interval (RemoveVirtualSystemSnapshotTree method) |
This property adjusts the job monitoring interval for monitoring requests to Hyper-V for processing (RemoveVirtualSystemSnapshotTree method). You do not need to change the value of this property. |
3 |
Input |
R |
common.returnValue |
Return value for the plugin |
The return value of this plugin stored. |
-- |
Output |
O |