virtual_machines
Creates, updates, deletes, gets or lists a virtual_machines
resource.
Overview
Name | virtual_machines |
Type | Resource |
Id | azure.dev_test_labs.virtual_machines |
Fields
- vw_virtual_machines
- virtual_machines
Name | Datatype | Description |
---|---|---|
id | text | The identifier of the resource. |
name | text | The name of the resource. |
allow_claim | text | field from the properties object |
applicable_schedule | text | field from the properties object |
artifact_deployment_status | text | field from the properties object |
artifacts | text | field from the properties object |
compute_id | text | field from the properties object |
compute_vm | text | field from the properties object |
created_by_user | text | field from the properties object |
created_by_user_id | text | field from the properties object |
created_date | text | field from the properties object |
custom_image_id | text | field from the properties object |
data_disk_parameters | text | field from the properties object |
disallow_public_ip_address | text | field from the properties object |
environment_id | text | field from the properties object |
expiration_date | text | field from the properties object |
fqdn | text | field from the properties object |
gallery_image_reference | text | field from the properties object |
is_authentication_with_ssh_key | text | field from the properties object |
labName | text | field from the properties object |
lab_subnet_name | text | field from the properties object |
lab_virtual_network_id | text | field from the properties object |
last_known_power_state | text | field from the properties object |
location | text | The location of the resource. |
network_interface | text | field from the properties object |
notes | text | field from the properties object |
os_type | text | field from the properties object |
owner_object_id | text | field from the properties object |
owner_user_principal_name | text | field from the properties object |
password | text | field from the properties object |
plan_id | text | field from the properties object |
provisioning_state | text | field from the properties object |
resourceGroupName | text | field from the properties object |
schedule_parameters | text | field from the properties object |
size | text | field from the properties object |
ssh_key | text | field from the properties object |
storage_type | text | field from the properties object |
subscriptionId | text | field from the properties object |
tags | text | The tags of the resource. |
type | text | The type of the resource. |
unique_identifier | text | field from the properties object |
user_name | text | field from the properties object |
virtual_machine_creation_source | text | field from the properties object |
Name | Datatype | Description |
---|---|---|
id | string | The identifier of the resource. |
name | string | The name of the resource. |
location | string | The location of the resource. |
properties | object | Properties of a virtual machine. |
tags | object | The tags of the resource. |
type | string | The type of the resource. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | labName, name, resourceGroupName, subscriptionId | Get virtual machine. |
list | SELECT | labName, resourceGroupName, subscriptionId | List virtual machines in a given lab. |
create_or_update | INSERT | labName, name, resourceGroupName, subscriptionId, data__properties | Create or replace an existing virtual machine. This operation can take a while to complete. |
delete | DELETE | labName, name, resourceGroupName, subscriptionId | Delete virtual machine. This operation can take a while to complete. |
update | UPDATE | labName, name, resourceGroupName, subscriptionId | Allows modifying tags of virtual machines. All other properties will be ignored. |
add_data_disk | EXEC | labName, name, resourceGroupName, subscriptionId | Attach a new or existing data disk to virtual machine. This operation can take a while to complete. |
apply_artifacts | EXEC | labName, name, resourceGroupName, subscriptionId | Apply artifacts to virtual machine. This operation can take a while to complete. |
claim | EXEC | labName, name, resourceGroupName, subscriptionId | Take ownership of an existing virtual machine This operation can take a while to complete. |
detach_data_disk | EXEC | labName, name, resourceGroupName, subscriptionId | Detach the specified disk from the virtual machine. This operation can take a while to complete. |
redeploy | EXEC | labName, name, resourceGroupName, subscriptionId | Redeploy a virtual machine This operation can take a while to complete. |
resize | EXEC | labName, name, resourceGroupName, subscriptionId | Resize Virtual Machine. This operation can take a while to complete. |
restart | EXEC | labName, name, resourceGroupName, subscriptionId | Restart a virtual machine. This operation can take a while to complete. |
start | EXEC | labName, name, resourceGroupName, subscriptionId | Start a virtual machine. This operation can take a while to complete. |
stop | EXEC | labName, name, resourceGroupName, subscriptionId | Stop a virtual machine This operation can take a while to complete. |
transfer_disks | EXEC | labName, name, resourceGroupName, subscriptionId | Transfers all data disks attached to the virtual machine to be owned by the current user. This operation can take a while to complete. |
un_claim | EXEC | labName, name, resourceGroupName, subscriptionId | Release ownership of an existing virtual machine This operation can take a while to complete. |
SELECT
examples
List virtual machines in a given lab.
- vw_virtual_machines
- virtual_machines
SELECT
id,
name,
allow_claim,
applicable_schedule,
artifact_deployment_status,
artifacts,
compute_id,
compute_vm,
created_by_user,
created_by_user_id,
created_date,
custom_image_id,
data_disk_parameters,
disallow_public_ip_address,
environment_id,
expiration_date,
fqdn,
gallery_image_reference,
is_authentication_with_ssh_key,
labName,
lab_subnet_name,
lab_virtual_network_id,
last_known_power_state,
location,
network_interface,
notes,
os_type,
owner_object_id,
owner_user_principal_name,
password,
plan_id,
provisioning_state,
resourceGroupName,
schedule_parameters,
size,
ssh_key,
storage_type,
subscriptionId,
tags,
type,
unique_identifier,
user_name,
virtual_machine_creation_source
FROM azure.dev_test_labs.vw_virtual_machines
WHERE labName = '{{ labName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';
SELECT
id,
name,
location,
properties,
tags,
type
FROM azure.dev_test_labs.virtual_machines
WHERE labName = '{{ labName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new virtual_machines
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.dev_test_labs.virtual_machines (
labName,
name,
resourceGroupName,
subscriptionId,
data__properties,
location,
tags,
properties
)
SELECT
'{{ labName }}',
'{{ name }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ data__properties }}',
'{{ location }}',
'{{ tags }}',
'{{ properties }}'
;
- name: your_resource_model_name
props:
- name: id
value: string
- name: name
value: string
- name: type
value: string
- name: location
value: string
- name: tags
value: object
- name: properties
value:
- name: notes
value: string
- name: ownerObjectId
value: string
- name: ownerUserPrincipalName
value: string
- name: createdByUserId
value: string
- name: createdByUser
value: string
- name: createdDate
value: string
- name: computeId
value: string
- name: customImageId
value: string
- name: osType
value: string
- name: size
value: string
- name: userName
value: string
- name: password
value: string
- name: sshKey
value: string
- name: isAuthenticationWithSshKey
value: boolean
- name: fqdn
value: string
- name: labSubnetName
value: string
- name: labVirtualNetworkId
value: string
- name: disallowPublicIpAddress
value: boolean
- name: artifacts
value:
- - name: artifactId
value: string
- name: artifactTitle
value: string
- name: parameters
value:
- - name: name
value: string
- name: value
value: string
- name: status
value: string
- name: deploymentStatusMessage
value: string
- name: vmExtensionStatusMessage
value: string
- name: installTime
value: string
- name: artifactDeploymentStatus
value:
- name: deploymentStatus
value: string
- name: artifactsApplied
value: integer
- name: totalArtifacts
value: integer
- name: galleryImageReference
value:
- name: offer
value: string
- name: publisher
value: string
- name: sku
value: string
- name: osType
value: string
- name: version
value: string
- name: planId
value: string
- name: computeVm
value:
- name: statuses
value:
- - name: code
value: string
- name: displayStatus
value: string
- name: message
value: string
- name: osType
value: string
- name: vmSize
value: string
- name: networkInterfaceId
value: string
- name: osDiskId
value: string
- name: dataDiskIds
value:
- string
- name: dataDisks
value:
- - name: name
value: string
- name: diskUri
value: string
- name: managedDiskId
value: string
- name: diskSizeGiB
value: integer
- name: networkInterface
value:
- name: virtualNetworkId
value: string
- name: subnetId
value: string
- name: publicIpAddressId
value: string
- name: publicIpAddress
value: string
- name: privateIpAddress
value: string
- name: dnsName
value: string
- name: rdpAuthority
value: string
- name: sshAuthority
value: string
- name: sharedPublicIpAddressConfiguration
value:
- name: inboundNatRules
value:
- - name: transportProtocol
value: string
- name: frontendPort
value: integer
- name: backendPort
value: integer
- name: applicableSchedule
value:
- name: id
value: string
- name: name
value: string
- name: type
value: string
- name: location
value: string
- name: tags
value: object
- name: properties
value:
- name: labVmsShutdown
value:
- name: id
value: string
- name: name
value: string
- name: type
value: string
- name: location
value: string
- name: tags
value: object
- name: properties
value:
- name: status
value: string
- name: taskType
value: string
- name: weeklyRecurrence
value:
- name: weekdays
value:
- string
- name: time
value: string
- name: dailyRecurrence
value:
- name: time
value: string
- name: hourlyRecurrence
value:
- name: minute
value: integer
- name: timeZoneId
value: string
- name: notificationSettings
value:
- name: status
value: string
- name: timeInMinutes
value: integer
- name: webhookUrl
value: string
- name: emailRecipient
value: string
- name: notificationLocale
value: string
- name: createdDate
value: string
- name: targetResourceId
value: string
- name: provisioningState
value: string
- name: uniqueIdentifier
value: string
- name: expirationDate
value: string
- name: allowClaim
value: boolean
- name: storageType
value: string
- name: virtualMachineCreationSource
value: string
- name: environmentId
value: string
- name: dataDiskParameters
value:
- - name: attachNewDataDiskOptions
value:
- name: diskSizeGiB
value: integer
- name: diskName
value: string
- name: diskType
value: string
- name: existingLabDiskId
value: string
- name: hostCaching
value: string
- name: scheduleParameters
value:
- - name: properties
value:
- name: status
value: string
- name: taskType
value: string
- name: timeZoneId
value: string
- name: targetResourceId
value: string
- name: name
value: string
- name: location
value: string
- name: tags
value: object
- name: lastKnownPowerState
value: string
- name: provisioningState
value: string
- name: uniqueIdentifier
value: string
UPDATE
example
Updates a virtual_machines
resource.
/*+ update */
UPDATE azure.dev_test_labs.virtual_machines
SET
tags = '{{ tags }}'
WHERE
labName = '{{ labName }}'
AND name = '{{ name }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';
DELETE
example
Deletes the specified virtual_machines
resource.
/*+ delete */
DELETE FROM azure.dev_test_labs.virtual_machines
WHERE labName = '{{ labName }}'
AND name = '{{ name }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';