virtual_machines
Creates, updates, deletes, gets or lists a virtual_machines resource.
Overview
| Name | virtual_machines |
| Type | Resource |
| Id | azure_extras.lab_services.virtual_machines |
Fields
The following fields are returned by SELECT queries:
- get
- list_by_lab
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
claimedByUserId | string | The lab user ID (not the PUID!) of who claimed the virtual machine. |
connectionProfile | object | Profile for information about connecting to the virtual machine. |
provisioningState | string | Current provisioning state of the virtual machine. Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Failed", and "Locked". |
state | string | The current state of the virtual machine. Known values are: "Stopped", "Starting", "Running", "Stopping", "ResettingPassword", "Reimaging", and "Redeploying". |
systemData | object | System data of the Lab virtual machine. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
vmType | string | The type of this VM resource. Known values are: "User" and "Template". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
claimedByUserId | string | The lab user ID (not the PUID!) of who claimed the virtual machine. |
connectionProfile | object | Profile for information about connecting to the virtual machine. |
provisioningState | string | Current provisioning state of the virtual machine. Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Failed", and "Locked". |
state | string | The current state of the virtual machine. Known values are: "Stopped", "Starting", "Running", "Stopping", "ResettingPassword", "Reimaging", and "Redeploying". |
systemData | object | System data of the Lab virtual machine. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
vmType | string | The type of this VM resource. Known values are: "User" and "Template". |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, lab_name, virtual_machine_name, subscription_id | Get a lab virtual machine. Returns the properties for a lab virtual machine. | |
list_by_lab | select | resource_group_name, lab_name, subscription_id | $filter | Get all virtual machines for a lab. Returns a list of all virtual machines for a lab. |
start | exec | resource_group_name, lab_name, virtual_machine_name, subscription_id | Start a lab virtual machine. Action to start a lab virtual machine. | |
stop | exec | resource_group_name, lab_name, virtual_machine_name, subscription_id | Stop a lab virtual machine. Action to stop a lab virtual machine. | |
reimage | exec | resource_group_name, lab_name, virtual_machine_name, subscription_id | Re-image a lab virtual machine. Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published snapshot of the reference environment of the lab. | |
redeploy | exec | resource_group_name, lab_name, virtual_machine_name, subscription_id | Redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. | |
reset_password | exec | resource_group_name, lab_name, virtual_machine_name, subscription_id, username, password | Reset a lab virtual machine password. Resets a lab virtual machine password. |
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 |
|---|---|---|
lab_name | string | The name of the lab that uniquely identifies it within containing lab plan. Used in resource URIs. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
subscription_id | string | |
virtual_machine_name | string | The ID of the virtual machine that uniquely identifies it within the containing lab. Used in resource URIs. Required. |
$filter | string | The filter to apply to the operation. Default value is None. |
SELECT examples
- get
- list_by_lab
Get a lab virtual machine. Returns the properties for a lab virtual machine.
SELECT
id,
name,
claimedByUserId,
connectionProfile,
provisioningState,
state,
systemData,
type,
vmType
FROM azure_extras.lab_services.virtual_machines
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND lab_name = '{{ lab_name }}' -- required
AND virtual_machine_name = '{{ virtual_machine_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Get all virtual machines for a lab. Returns a list of all virtual machines for a lab.
SELECT
id,
name,
claimedByUserId,
connectionProfile,
provisioningState,
state,
systemData,
type,
vmType
FROM azure_extras.lab_services.virtual_machines
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND lab_name = '{{ lab_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $filter = '{{ $filter }}'
;
Lifecycle Methods
- start
- stop
- reimage
- redeploy
- reset_password
Start a lab virtual machine. Action to start a lab virtual machine.
EXEC azure_extras.lab_services.virtual_machines.start
@resource_group_name='{{ resource_group_name }}' --required,
@lab_name='{{ lab_name }}' --required,
@virtual_machine_name='{{ virtual_machine_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Stop a lab virtual machine. Action to stop a lab virtual machine.
EXEC azure_extras.lab_services.virtual_machines.stop
@resource_group_name='{{ resource_group_name }}' --required,
@lab_name='{{ lab_name }}' --required,
@virtual_machine_name='{{ virtual_machine_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Re-image a lab virtual machine. Re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published snapshot of the reference environment of the lab.
EXEC azure_extras.lab_services.virtual_machines.reimage
@resource_group_name='{{ resource_group_name }}' --required,
@lab_name='{{ lab_name }}' --required,
@virtual_machine_name='{{ virtual_machine_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. Action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity.
EXEC azure_extras.lab_services.virtual_machines.redeploy
@resource_group_name='{{ resource_group_name }}' --required,
@lab_name='{{ lab_name }}' --required,
@virtual_machine_name='{{ virtual_machine_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Reset a lab virtual machine password. Resets a lab virtual machine password.
EXEC azure_extras.lab_services.virtual_machines.reset_password
@resource_group_name='{{ resource_group_name }}' --required,
@lab_name='{{ lab_name }}' --required,
@virtual_machine_name='{{ virtual_machine_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"username": "{{ username }}",
"password": "{{ password }}"
}'
;