Skip to main content

virtual_machine_instances

Creates, updates, deletes, gets or lists a virtual_machine_instances resource.

Overview

Namevirtual_machine_instances
TypeResource
Idazure.scvmm.virtual_machine_instances

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
namestringThe name of the resource.
availabilitySetsarrayAvailability Sets in vm.
extendedLocationobjectGets or sets the extended location. Required.
hardwareProfileobjectHardware properties.
infrastructureProfileobjectGets the infrastructure profile.
networkProfileobjectNetwork properties.
osProfileobjectOS properties.
powerStatestringGets the power state of the virtual machine.
provisioningStatestringProvisioning state of the resource. Known values are: "Succeeded", "Failed", "Canceled", "Provisioning", "Updating", "Deleting", "Accepted", and "Created".
storageProfileobjectStorage properties.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_uriGets a virtual machine. Retrieves information about a virtual machine instance.
create_or_updateinsertresource_uri, extendedLocationImplements 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.
updateupdateresource_uriUpdates a virtual machine. The operation to update a virtual machine instance.
create_or_updatereplaceresource_uri, extendedLocationImplements 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.
deletedeleteresource_uriforce, deleteFromHostDeletes an virtual machine. The operation to delete a virtual machine instance.
create_checkpointexecresource_uriImplements the operation to creates a checkpoint in a virtual machine instance. Creates a checkpoint in virtual machine instance.
delete_checkpointexecresource_uriImplements the operation to delete a checkpoint in a virtual machine instance. Deletes a checkpoint in virtual machine instance.
restartexecresource_uriImplements the operation to restart a virtual machine. The operation to restart a virtual machine instance.
restore_checkpointexecresource_uriImplements the operation to restores to a checkpoint in a virtual machine instance. Restores to a checkpoint in virtual machine instance.
startexecresource_uriImplements the operation to start a virtual machine. The operation to start a virtual machine instance.
stopexecresource_uriImplements the operation to stop a virtual machine. The operation to power off (stop) a virtual machine instance.
list_rawexecresource_uriImplements 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.

NameDatatypeDescription
resource_uristringThe fully qualified Azure Resource manager identifier of the resource. Required.
deleteFromHoststringWhether to disable the VM from azure and also delete it from Vmm. Known values are: "true" and "false". Default value is None.
forcestringForces the resource to be deleted. Known values are: "true" and "false". Default value is None.

SELECT examples

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

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
;

UPDATE examples

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

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

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

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 }}"
}'
;