virtual_machine_instances
Creates, updates, deletes, gets or lists a virtual_machine_instances resource.
Overview
| Name | virtual_machine_instances |
| Type | Resource |
| Id | azure.scvmm.virtual_machine_instances |
Fields
The following fields are returned by SELECT queries:
- get
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long |
name | string | The name of the resource. |
availabilitySets | array | Availability Sets in vm. |
extendedLocation | object | Gets or sets the extended location. Required. |
hardwareProfile | object | Hardware properties. |
infrastructureProfile | object | Gets the infrastructure profile. |
networkProfile | object | Network properties. |
osProfile | object | OS properties. |
powerState | string | Gets the power state of the virtual machine. |
provisioningState | string | Provisioning state of the resource. Known values are: "Succeeded", "Failed", "Canceled", "Provisioning", "Updating", "Deleting", "Accepted", and "Created". |
storageProfile | object | Storage properties. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_uri | Gets a virtual machine. Retrieves information about a virtual machine instance. | |
create_or_update | insert | resource_uri, extendedLocation | Implements virtual machine PUT method. The operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. | |
update | update | resource_uri | Updates a virtual machine. The operation to update a virtual machine instance. | |
create_or_update | replace | resource_uri, extendedLocation | Implements virtual machine PUT method. The operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. | |
delete | delete | resource_uri | force, deleteFromHost | Deletes an virtual machine. The operation to delete a virtual machine instance. |
create_checkpoint | exec | resource_uri | Implements the operation to creates a checkpoint in a virtual machine instance. Creates a checkpoint in virtual machine instance. | |
delete_checkpoint | exec | resource_uri | Implements the operation to delete a checkpoint in a virtual machine instance. Deletes a checkpoint in virtual machine instance. | |
restart | exec | resource_uri | Implements the operation to restart a virtual machine. The operation to restart a virtual machine instance. | |
restore_checkpoint | exec | resource_uri | Implements the operation to restores to a checkpoint in a virtual machine instance. Restores to a checkpoint in virtual machine instance. | |
start | exec | resource_uri | Implements the operation to start a virtual machine. The operation to start a virtual machine instance. | |
stop | exec | resource_uri | Implements the operation to stop a virtual machine. The operation to power off (stop) a virtual machine instance. | |
list_raw | exec | resource_uri | Implements List virtual machine instances. Lists all of the virtual machine instances within the specified parent resource. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
resource_uri | string | The fully qualified Azure Resource manager identifier of the resource. Required. |
deleteFromHost | string | Whether to disable the VM from azure and also delete it from Vmm. Known values are: "true" and "false". Default value is None. |
force | string | Forces the resource to be deleted. Known values are: "true" and "false". Default value is None. |
SELECT examples
- get
Gets a virtual machine. Retrieves information about a virtual machine instance.
SELECT
id,
name,
availabilitySets,
extendedLocation,
hardwareProfile,
infrastructureProfile,
networkProfile,
osProfile,
powerState,
provisioningState,
storageProfile,
systemData,
type
FROM azure.scvmm.virtual_machine_instances
WHERE resource_uri = '{{ resource_uri }}' -- required
;
INSERT examples
- create_or_update
- Manifest
Implements virtual machine PUT method. The operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation.
INSERT INTO azure.scvmm.virtual_machine_instances (
properties,
extendedLocation,
resource_uri
)
SELECT
'{{ properties }}',
'{{ extendedLocation }}' /* required */,
'{{ resource_uri }}'
RETURNING
id,
name,
extendedLocation,
properties,
systemData,
type
;
# Description fields are for documentation purposes
- name: virtual_machine_instances
props:
- name: resource_uri
value: "{{ resource_uri }}"
description: Required parameter for the virtual_machine_instances resource.
- name: properties
description: |
The resource-specific properties for this resource.
value:
availabilitySets:
- id: "{{ id }}"
name: "{{ name }}"
osProfile:
adminPassword: "{{ adminPassword }}"
computerName: "{{ computerName }}"
osType: "{{ osType }}"
osSku: "{{ osSku }}"
osVersion: "{{ osVersion }}"
hardwareProfile:
memoryMB: {{ memoryMB }}
cpuCount: {{ cpuCount }}
limitCpuForMigration: "{{ limitCpuForMigration }}"
dynamicMemoryEnabled: "{{ dynamicMemoryEnabled }}"
dynamicMemoryMaxMB: {{ dynamicMemoryMaxMB }}
dynamicMemoryMinMB: {{ dynamicMemoryMinMB }}
isHighlyAvailable: "{{ isHighlyAvailable }}"
networkProfile:
networkInterfaces:
- name: "{{ name }}"
displayName: "{{ displayName }}"
ipv4Addresses: "{{ ipv4Addresses }}"
ipv6Addresses: "{{ ipv6Addresses }}"
macAddress: "{{ macAddress }}"
virtualNetworkId: "{{ virtualNetworkId }}"
networkName: "{{ networkName }}"
ipv4AddressType: "{{ ipv4AddressType }}"
ipv6AddressType: "{{ ipv6AddressType }}"
macAddressType: "{{ macAddressType }}"
nicId: "{{ nicId }}"
storageProfile:
disks:
- name: "{{ name }}"
displayName: "{{ displayName }}"
diskId: "{{ diskId }}"
diskSizeGB: {{ diskSizeGB }}
maxDiskSizeGB: {{ maxDiskSizeGB }}
bus: {{ bus }}
lun: {{ lun }}
busType: "{{ busType }}"
vhdType: "{{ vhdType }}"
volumeType: "{{ volumeType }}"
vhdFormatType: "{{ vhdFormatType }}"
templateDiskId: "{{ templateDiskId }}"
storageQoSPolicy:
name: "{{ name }}"
id: "{{ id }}"
createDiffDisk: "{{ createDiffDisk }}"
infrastructureProfile:
inventoryItemId: "{{ inventoryItemId }}"
vmmServerId: "{{ vmmServerId }}"
cloudId: "{{ cloudId }}"
templateId: "{{ templateId }}"
vmName: "{{ vmName }}"
uuid: "{{ uuid }}"
lastRestoredVMCheckpoint:
parentCheckpointID: "{{ parentCheckpointID }}"
checkpointID: "{{ checkpointID }}"
name: "{{ name }}"
description: "{{ description }}"
checkpoints:
- parentCheckpointID: "{{ parentCheckpointID }}"
checkpointID: "{{ checkpointID }}"
name: "{{ name }}"
description: "{{ description }}"
checkpointType: "{{ checkpointType }}"
generation: {{ generation }}
biosGuid: "{{ biosGuid }}"
powerState: "{{ powerState }}"
provisioningState: "{{ provisioningState }}"
- name: extendedLocation
description: |
Gets or sets the extended location. Required.
value:
type: "{{ type }}"
name: "{{ name }}"
UPDATE examples
- update
Updates a virtual machine. The operation to update a virtual machine instance.
UPDATE azure.scvmm.virtual_machine_instances
SET
properties = '{{ properties }}'
WHERE
resource_uri = '{{ resource_uri }}' --required
RETURNING
id,
name,
extendedLocation,
properties,
systemData,
type;
REPLACE examples
- create_or_update
Implements virtual machine PUT method. The operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation.
REPLACE azure.scvmm.virtual_machine_instances
SET
properties = '{{ properties }}',
extendedLocation = '{{ extendedLocation }}'
WHERE
resource_uri = '{{ resource_uri }}' --required
AND extendedLocation = '{{ extendedLocation }}' --required
RETURNING
id,
name,
extendedLocation,
properties,
systemData,
type;
DELETE examples
- delete
Deletes an virtual machine. The operation to delete a virtual machine instance.
DELETE FROM azure.scvmm.virtual_machine_instances
WHERE resource_uri = '{{ resource_uri }}' --required
AND force = '{{ force }}'
AND deleteFromHost = '{{ deleteFromHost }}'
;
Lifecycle Methods
- create_checkpoint
- delete_checkpoint
- restart
- restore_checkpoint
- start
- stop
- list_raw
Implements the operation to creates a checkpoint in a virtual machine instance. Creates a checkpoint in virtual machine instance.
EXEC azure.scvmm.virtual_machine_instances.create_checkpoint
@resource_uri='{{ resource_uri }}' --required
@@json=
'{
"name": "{{ name }}",
"description": "{{ description }}"
}'
;
Implements the operation to delete a checkpoint in a virtual machine instance. Deletes a checkpoint in virtual machine instance.
EXEC azure.scvmm.virtual_machine_instances.delete_checkpoint
@resource_uri='{{ resource_uri }}' --required
@@json=
'{
"id": "{{ id }}"
}'
;
Implements the operation to restart a virtual machine. The operation to restart a virtual machine instance.
EXEC azure.scvmm.virtual_machine_instances.restart
@resource_uri='{{ resource_uri }}' --required
;
Implements the operation to restores to a checkpoint in a virtual machine instance. Restores to a checkpoint in virtual machine instance.
EXEC azure.scvmm.virtual_machine_instances.restore_checkpoint
@resource_uri='{{ resource_uri }}' --required
@@json=
'{
"id": "{{ id }}"
}'
;
Implements the operation to start a virtual machine. The operation to start a virtual machine instance.
EXEC azure.scvmm.virtual_machine_instances.start
@resource_uri='{{ resource_uri }}' --required
;
Implements the operation to stop a virtual machine. The operation to power off (stop) a virtual machine instance.
EXEC azure.scvmm.virtual_machine_instances.stop
@resource_uri='{{ resource_uri }}' --required
@@json=
'{
"skipShutdown": "{{ skipShutdown }}"
}'
;
Implements List virtual machine instances. Lists all of the virtual machine instances within the specified parent resource.
EXEC azure.scvmm.virtual_machine_instances.list_raw
@resource_uri='{{ resource_uri }}' --required
;