virtual_machine_instances
Creates, updates, deletes, gets or lists a virtual_machine_instances resource.
Overview
| Name | virtual_machine_instances |
| Type | Resource |
| Id | azure_stack.azure_stack_hci_vm.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. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
createFromLocal | boolean | Boolean indicating whether this is an existing local virtual machine or if one should be created. |
extendedLocation | object | The extendedLocation of the resource. |
guestAgentInstallStatus | object | Guest agent install status. |
hardwareProfile | object | HardwareProfile - Specifies the hardware settings for the virtual machine instance. |
hostNodeIpAddress | string | Name of the host node that the VM is on. |
hostNodeName | string | Name of the host node that the VM is on. |
httpProxyConfig | object | HTTP Proxy configuration for the VM. |
hyperVVmId | string | Unique identifier for the Hyper-V VM resource. |
identity | object | The managed service identities assigned to this resource. |
instanceView | object | The virtual machine instance view. |
networkProfile | object | NetworkProfile - describes the network configuration the virtual machine instance. |
osProfile | object | OsProfile - describes the configuration of the operating system and sets login data. |
placementProfile | object | PlacementProfile - Specifies the placement related settings for the virtual machine. |
provisioningState | string | Provisioning state of the virtual machine instance. Known values are: "Succeeded", "Failed", "InProgress", "Accepted", "Deleting", and "Canceled". (Succeeded, Failed, InProgress, Accepted, Deleting, Canceled) |
resourceUid | string | Unique identifier defined by ARC to identify the guest of the VM. |
securityProfile | object | SecurityProfile - Specifies the security settings for the virtual machine instance. |
status | object | The observed state of virtual machine instances. |
storageProfile | object | StorageProfile - contains information about the disks and storage information for the virtual machine instance. |
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". |
vmId | string | Unique identifier for the vm resource. |
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 instance. | |
create_or_update | insert | resource_uri | 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 | The operation to update a virtual machine instance. | |
create_or_update | replace | resource_uri | 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 | The operation to delete a virtual machine instance. | |
start | exec | resource_uri | The operation to start a virtual machine instance. | |
stop | exec | resource_uri | The operation to stop a virtual machine instance. | |
restart | exec | resource_uri | The operation to restart a virtual machine instance. | |
pause | exec | resource_uri | The operation to pause a virtual machine instance. | |
save | exec | resource_uri | The operation to save a virtual machine instance. | |
list_raw | exec | resource_uri | 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. |
SELECT examples
- get
Gets a virtual machine instance.
SELECT
id,
name,
createFromLocal,
extendedLocation,
guestAgentInstallStatus,
hardwareProfile,
hostNodeIpAddress,
hostNodeName,
httpProxyConfig,
hyperVVmId,
identity,
instanceView,
networkProfile,
osProfile,
placementProfile,
provisioningState,
resourceUid,
securityProfile,
status,
storageProfile,
systemData,
type,
vmId
FROM azure_stack.azure_stack_hci_vm.virtual_machine_instances
WHERE resource_uri = '{{ resource_uri }}' -- required
;
INSERT examples
- create_or_update
- Manifest
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_stack.azure_stack_hci_vm.virtual_machine_instances (
properties,
extendedLocation,
identity,
resource_uri
)
SELECT
'{{ properties }}',
'{{ extendedLocation }}',
'{{ identity }}',
'{{ resource_uri }}'
RETURNING
id,
name,
extendedLocation,
identity,
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:
hardwareProfile:
vmSize: "{{ vmSize }}"
processors: {{ processors }}
memoryMB: {{ memoryMB }}
dynamicMemoryConfig:
maximumMemoryMB: {{ maximumMemoryMB }}
minimumMemoryMB: {{ minimumMemoryMB }}
targetMemoryBuffer: {{ targetMemoryBuffer }}
virtualMachineGPUs:
- assignmentType: "{{ assignmentType }}"
partitionSizeMB: {{ partitionSizeMB }}
gpuName: "{{ gpuName }}"
placementProfile:
zone: "{{ zone }}"
strictPlacementPolicy: {{ strictPlacementPolicy }}
networkProfile:
networkInterfaces:
- id: "{{ id }}"
osProfile:
adminPassword: "{{ adminPassword }}"
adminUsername: "{{ adminUsername }}"
computerName: "{{ computerName }}"
linuxConfiguration:
disablePasswordAuthentication: {{ disablePasswordAuthentication }}
ssh:
publicKeys:
- path: "{{ path }}"
keyData: "{{ keyData }}"
provisionVMAgent: {{ provisionVMAgent }}
provisionVMConfigAgent: {{ provisionVMConfigAgent }}
windowsConfiguration:
enableAutomaticUpdates: {{ enableAutomaticUpdates }}
ssh:
publicKeys:
- path: "{{ path }}"
keyData: "{{ keyData }}"
timeZone: "{{ timeZone }}"
provisionVMAgent: {{ provisionVMAgent }}
provisionVMConfigAgent: {{ provisionVMConfigAgent }}
securityProfile:
enableTPM: {{ enableTPM }}
uefiSettings:
secureBootEnabled: {{ secureBootEnabled }}
securityType: "{{ securityType }}"
storageProfile:
dataDisks:
- id: "{{ id }}"
imageReference:
id: "{{ id }}"
osDisk:
id: "{{ id }}"
osType: "{{ osType }}"
managedDisk:
securityProfile:
securityEncryptionType: "{{ securityEncryptionType }}"
vmConfigStoragePathId: "{{ vmConfigStoragePathId }}"
httpProxyConfig:
httpProxy: "{{ httpProxy }}"
httpsProxy: "{{ httpsProxy }}"
noProxy:
- "{{ noProxy }}"
trustedCa: "{{ trustedCa }}"
createFromLocal: {{ createFromLocal }}
provisioningState: "{{ provisioningState }}"
instanceView:
vmAgent:
vmConfigAgentVersion: "{{ vmConfigAgentVersion }}"
statuses:
- code: "{{ code }}"
level: "{{ level }}"
displayStatus: "{{ displayStatus }}"
message: "{{ message }}"
time: "{{ time }}"
status:
errorCode: "{{ errorCode }}"
errorMessage: "{{ errorMessage }}"
powerState: "{{ powerState }}"
provisioningStatus:
operationId: "{{ operationId }}"
status: "{{ status }}"
guestAgentInstallStatus:
vmUuid: "{{ vmUuid }}"
status: "{{ status }}"
lastStatusChange: "{{ lastStatusChange }}"
agentVersion: "{{ agentVersion }}"
errorDetails:
- code: "{{ code }}"
message: "{{ message }}"
target: "{{ target }}"
details: "{{ details }}"
additionalInfo: "{{ additionalInfo }}"
vmId: "{{ vmId }}"
resourceUid: "{{ resourceUid }}"
hyperVVmId: "{{ hyperVVmId }}"
hostNodeName: "{{ hostNodeName }}"
hostNodeIpAddress: "{{ hostNodeIpAddress }}"
- name: extendedLocation
description: |
The extendedLocation of the resource.
value:
name: "{{ name }}"
type: "{{ type }}"
- name: identity
description: |
The managed service identities assigned to this resource.
value:
principalId: "{{ principalId }}"
tenantId: "{{ tenantId }}"
type: "{{ type }}"
userAssignedIdentities: "{{ userAssignedIdentities }}"
UPDATE examples
- update
The operation to update a virtual machine instance.
UPDATE azure_stack.azure_stack_hci_vm.virtual_machine_instances
SET
properties = '{{ properties }}',
identity = '{{ identity }}'
WHERE
resource_uri = '{{ resource_uri }}' --required
RETURNING
id,
name,
extendedLocation,
identity,
properties,
systemData,
type;
REPLACE examples
- create_or_update
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_stack.azure_stack_hci_vm.virtual_machine_instances
SET
properties = '{{ properties }}',
extendedLocation = '{{ extendedLocation }}',
identity = '{{ identity }}'
WHERE
resource_uri = '{{ resource_uri }}' --required
RETURNING
id,
name,
extendedLocation,
identity,
properties,
systemData,
type;
DELETE examples
- delete
The operation to delete a virtual machine instance.
DELETE FROM azure_stack.azure_stack_hci_vm.virtual_machine_instances
WHERE resource_uri = '{{ resource_uri }}' --required
;
Lifecycle Methods
- start
- stop
- restart
- pause
- save
- list_raw
The operation to start a virtual machine instance.
EXEC azure_stack.azure_stack_hci_vm.virtual_machine_instances.start
@resource_uri='{{ resource_uri }}' --required
;
The operation to stop a virtual machine instance.
EXEC azure_stack.azure_stack_hci_vm.virtual_machine_instances.stop
@resource_uri='{{ resource_uri }}' --required
;
The operation to restart a virtual machine instance.
EXEC azure_stack.azure_stack_hci_vm.virtual_machine_instances.restart
@resource_uri='{{ resource_uri }}' --required
;
The operation to pause a virtual machine instance.
EXEC azure_stack.azure_stack_hci_vm.virtual_machine_instances.pause
@resource_uri='{{ resource_uri }}' --required
;
The operation to save a virtual machine instance.
EXEC azure_stack.azure_stack_hci_vm.virtual_machine_instances.save
@resource_uri='{{ resource_uri }}' --required
;
Lists all of the virtual machine instances within the specified parent resource.
EXEC azure_stack.azure_stack_hci_vm.virtual_machine_instances.list_raw
@resource_uri='{{ resource_uri }}' --required
;