virtual_machines
Creates, updates, deletes, gets or lists a virtual_machines resource.
Overview
| Name | virtual_machines |
| Type | Resource |
| Id | azure_isv.vmwarecloudsimple.virtual_machines |
Fields
The following fields are returned by SELECT queries:
- get
- list_by_resource_group
- list_by_subscription
| Name | Datatype | Description |
|---|---|---|
id | string | /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/virtualMachines/{virtualMachineName}. |
name | string | {virtualMachineName}. |
amountOfRam | integer | The amount of memory. |
controllers | array | The list of Virtual Disks' Controllers. |
customization | object | Virtual machine properties. |
disks | array | The list of Virtual Disks. |
dnsname | string | The DNS name of Virtual Machine in VCenter. |
exposeToGuestVM | boolean | Expose Guest OS or not. |
folder | string | The path to virtual machine folder in VCenter. |
guestOS | string | The name of Guest OS. |
guestOSType | string | The Guest OS type. Known values are: "linux", "windows", and "other". |
location | string | Azure region. Required. |
nics | array | The list of Virtual NICs. |
numberOfCores | integer | The number of CPU cores. |
password | string | Password for login. Deprecated - use customization property. |
privateCloudId | string | Private Cloud Id. |
provisioningState | string | The provisioning status of the resource. |
publicIP | string | The public ip of Virtual Machine. |
resourcePool | object | Resource pool model. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. |
status | string | The status of Virtual machine. Known values are: "running", "suspended", "poweredoff", "updating", "deallocating", and "deleting". |
tags | object | The list of tags. |
templateId | string | Virtual Machine Template Id. |
type | string | {resourceProviderNamespace}/{resourceType}. |
username | string | Username for login. Deprecated - use customization property. |
vSphereNetworks | array | The list of Virtual VSphere Networks. |
vmId | string | The internal id of Virtual Machine in VCenter. |
vmwaretools | string | VMware tools version. |
| Name | Datatype | Description |
|---|---|---|
id | string | /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/virtualMachines/{virtualMachineName}. |
name | string | {virtualMachineName}. |
amountOfRam | integer | The amount of memory. |
controllers | array | The list of Virtual Disks' Controllers. |
customization | object | Virtual machine properties. |
disks | array | The list of Virtual Disks. |
dnsname | string | The DNS name of Virtual Machine in VCenter. |
exposeToGuestVM | boolean | Expose Guest OS or not. |
folder | string | The path to virtual machine folder in VCenter. |
guestOS | string | The name of Guest OS. |
guestOSType | string | The Guest OS type. Known values are: "linux", "windows", and "other". |
location | string | Azure region. Required. |
nics | array | The list of Virtual NICs. |
numberOfCores | integer | The number of CPU cores. |
password | string | Password for login. Deprecated - use customization property. |
privateCloudId | string | Private Cloud Id. |
provisioningState | string | The provisioning status of the resource. |
publicIP | string | The public ip of Virtual Machine. |
resourcePool | object | Resource pool model. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. |
status | string | The status of Virtual machine. Known values are: "running", "suspended", "poweredoff", "updating", "deallocating", and "deleting". |
tags | object | The list of tags. |
templateId | string | Virtual Machine Template Id. |
type | string | {resourceProviderNamespace}/{resourceType}. |
username | string | Username for login. Deprecated - use customization property. |
vSphereNetworks | array | The list of Virtual VSphere Networks. |
vmId | string | The internal id of Virtual Machine in VCenter. |
vmwaretools | string | VMware tools version. |
| Name | Datatype | Description |
|---|---|---|
id | string | /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/virtualMachines/{virtualMachineName}. |
name | string | {virtualMachineName}. |
amountOfRam | integer | The amount of memory. |
controllers | array | The list of Virtual Disks' Controllers. |
customization | object | Virtual machine properties. |
disks | array | The list of Virtual Disks. |
dnsname | string | The DNS name of Virtual Machine in VCenter. |
exposeToGuestVM | boolean | Expose Guest OS or not. |
folder | string | The path to virtual machine folder in VCenter. |
guestOS | string | The name of Guest OS. |
guestOSType | string | The Guest OS type. Known values are: "linux", "windows", and "other". |
location | string | Azure region. Required. |
nics | array | The list of Virtual NICs. |
numberOfCores | integer | The number of CPU cores. |
password | string | Password for login. Deprecated - use customization property. |
privateCloudId | string | Private Cloud Id. |
provisioningState | string | The provisioning status of the resource. |
publicIP | string | The public ip of Virtual Machine. |
resourcePool | object | Resource pool model. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. |
status | string | The status of Virtual machine. Known values are: "running", "suspended", "poweredoff", "updating", "deallocating", and "deleting". |
tags | object | The list of tags. |
templateId | string | Virtual Machine Template Id. |
type | string | {resourceProviderNamespace}/{resourceType}. |
username | string | Username for login. Deprecated - use customization property. |
vSphereNetworks | array | The list of Virtual VSphere Networks. |
vmId | string | The internal id of Virtual Machine in VCenter. |
vmwaretools | string | VMware tools version. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, virtual_machine_name, subscription_id | Implements virtual machine GET method. Get virtual machine. | |
list_by_resource_group | select | resource_group_name, subscription_id | $filter, $top, $skipToken | Implements list virtual machine within RG method. Returns list of virtual machine within resource group. |
list_by_subscription | select | subscription_id | $filter, $top, $skipToken | Implements list virtual machine within subscription method. Returns list virtual machine within subscription. |
create_or_update | insert | resource_group_name, virtual_machine_name, subscription_id, Referer, location | Implements virtual machine PUT method. Create Or Update Virtual Machine. | |
update | update | resource_group_name, virtual_machine_name, subscription_id | Implements virtual machine PATCH method. Patch virtual machine properties. | |
create_or_update | replace | resource_group_name, virtual_machine_name, subscription_id, Referer, location | Implements virtual machine PUT method. Create Or Update Virtual Machine. | |
delete | delete | resource_group_name, virtual_machine_name, subscription_id, Referer | Implements virtual machine DELETE method. Delete virtual machine. | |
start | exec | resource_group_name, virtual_machine_name, subscription_id, Referer | Implements a start method for a virtual machine. Power on virtual machine. | |
stop | exec | resource_group_name, virtual_machine_name, subscription_id, Referer | mode | Implements shutdown, poweroff, and suspend method for a virtual machine. Power off virtual machine, options: shutdown, poweroff, and suspend. |
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 |
|---|---|---|
Referer | string | referer url. Required. |
resource_group_name | string | The name of the resource group. Required. |
subscription_id | string | |
virtual_machine_name | string | virtual machine name. Required. |
$filter | string | The filter to apply on the list operation. Default value is None. |
$skipToken | string | to be used by nextLink implementation. Default value is None. |
$top | integer | The maximum number of record sets to return. Default value is None. |
mode | string | query stop mode parameter (reboot, shutdown, etc...). Known values are: "reboot", "suspend", "shutdown", and "poweroff". Default value is None. |
SELECT examples
- get
- list_by_resource_group
- list_by_subscription
Implements virtual machine GET method. Get virtual machine.
SELECT
id,
name,
amountOfRam,
controllers,
customization,
disks,
dnsname,
exposeToGuestVM,
folder,
guestOS,
guestOSType,
location,
nics,
numberOfCores,
password,
privateCloudId,
provisioningState,
publicIP,
resourcePool,
status,
tags,
templateId,
type,
username,
vSphereNetworks,
vmId,
vmwaretools
FROM azure_isv.vmwarecloudsimple.virtual_machines
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND virtual_machine_name = '{{ virtual_machine_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Implements list virtual machine within RG method. Returns list of virtual machine within resource group.
SELECT
id,
name,
amountOfRam,
controllers,
customization,
disks,
dnsname,
exposeToGuestVM,
folder,
guestOS,
guestOSType,
location,
nics,
numberOfCores,
password,
privateCloudId,
provisioningState,
publicIP,
resourcePool,
status,
tags,
templateId,
type,
username,
vSphereNetworks,
vmId,
vmwaretools
FROM azure_isv.vmwarecloudsimple.virtual_machines
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $filter = '{{ $filter }}'
AND $top = '{{ $top }}'
AND $skipToken = '{{ $skipToken }}'
;
Implements list virtual machine within subscription method. Returns list virtual machine within subscription.
SELECT
id,
name,
amountOfRam,
controllers,
customization,
disks,
dnsname,
exposeToGuestVM,
folder,
guestOS,
guestOSType,
location,
nics,
numberOfCores,
password,
privateCloudId,
provisioningState,
publicIP,
resourcePool,
status,
tags,
templateId,
type,
username,
vSphereNetworks,
vmId,
vmwaretools
FROM azure_isv.vmwarecloudsimple.virtual_machines
WHERE subscription_id = '{{ subscription_id }}' -- required
AND $filter = '{{ $filter }}'
AND $top = '{{ $top }}'
AND $skipToken = '{{ $skipToken }}'
;
INSERT examples
- create_or_update
- Manifest
Implements virtual machine PUT method. Create Or Update Virtual Machine.
INSERT INTO azure_isv.vmwarecloudsimple.virtual_machines (
location,
tags,
properties,
resource_group_name,
virtual_machine_name,
subscription_id,
Referer
)
SELECT
'{{ location }}' /* required */,
'{{ tags }}',
'{{ properties }}',
'{{ resource_group_name }}',
'{{ virtual_machine_name }}',
'{{ subscription_id }}',
'{{ Referer }}'
RETURNING
id,
name,
location,
properties,
tags,
type
;
# Description fields are for documentation purposes
- name: virtual_machines
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the virtual_machines resource.
- name: virtual_machine_name
value: "{{ virtual_machine_name }}"
description: Required parameter for the virtual_machines resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the virtual_machines resource.
- name: Referer
value: "{{ Referer }}"
description: Required parameter for the virtual_machines resource.
- name: location
value: "{{ location }}"
description: |
Azure region. Required.
- name: tags
value: "{{ tags }}"
description: |
The list of tags.
- name: properties
value:
amountOfRam: {{ amountOfRam }}
customization:
dnsServers:
- "{{ dnsServers }}"
hostName: "{{ hostName }}"
password: "{{ password }}"
policyId: "{{ policyId }}"
username: "{{ username }}"
disks:
- controllerId: "{{ controllerId }}"
independenceMode: "{{ independenceMode }}"
totalSize: {{ totalSize }}
virtualDiskId: "{{ virtualDiskId }}"
virtualDiskName: "{{ virtualDiskName }}"
exposeToGuestVM: {{ exposeToGuestVM }}
nics:
- customization:
allocation: "{{ allocation }}"
dnsServers:
- "{{ dnsServers }}"
gateway:
- "{{ gateway }}"
ipAddress: "{{ ipAddress }}"
mask: "{{ mask }}"
primaryWinsServer: "{{ primaryWinsServer }}"
secondaryWinsServer: "{{ secondaryWinsServer }}"
ipAddresses: "{{ ipAddresses }}"
macAddress: "{{ macAddress }}"
network:
assignable: {{ assignable }}
id: "{{ id }}"
location: "{{ location }}"
name: "{{ name }}"
type: "{{ type }}"
properties:
privateCloudId: "{{ privateCloudId }}"
nicType: "{{ nicType }}"
powerOnBoot: {{ powerOnBoot }}
virtualNicId: "{{ virtualNicId }}"
virtualNicName: "{{ virtualNicName }}"
numberOfCores: {{ numberOfCores }}
password: "{{ password }}"
privateCloudId: "{{ privateCloudId }}"
resourcePool:
id: "{{ id }}"
location: "{{ location }}"
name: "{{ name }}"
privateCloudId: "{{ privateCloudId }}"
type: "{{ type }}"
properties:
fullName: "{{ fullName }}"
templateId: "{{ templateId }}"
username: "{{ username }}"
vSphereNetworks:
- "{{ vSphereNetworks }}"
UPDATE examples
- update
Implements virtual machine PATCH method. Patch virtual machine properties.
UPDATE azure_isv.vmwarecloudsimple.virtual_machines
SET
tags = '{{ tags }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND virtual_machine_name = '{{ virtual_machine_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
location,
properties,
tags,
type;
REPLACE examples
- create_or_update
Implements virtual machine PUT method. Create Or Update Virtual Machine.
REPLACE azure_isv.vmwarecloudsimple.virtual_machines
SET
location = '{{ location }}',
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND virtual_machine_name = '{{ virtual_machine_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND Referer = '{{ Referer }}' --required
AND location = '{{ location }}' --required
RETURNING
id,
name,
location,
properties,
tags,
type;
DELETE examples
- delete
Implements virtual machine DELETE method. Delete virtual machine.
DELETE FROM azure_isv.vmwarecloudsimple.virtual_machines
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND virtual_machine_name = '{{ virtual_machine_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND Referer = '{{ Referer }}' --required
;
Lifecycle Methods
- start
- stop
Implements a start method for a virtual machine. Power on virtual machine.
EXEC azure_isv.vmwarecloudsimple.virtual_machines.start
@resource_group_name='{{ resource_group_name }}' --required,
@virtual_machine_name='{{ virtual_machine_name }}' --required,
@subscription_id='{{ subscription_id }}' --required,
@Referer='{{ Referer }}' --required
;
Implements shutdown, poweroff, and suspend method for a virtual machine. Power off virtual machine, options: shutdown, poweroff, and suspend.
EXEC azure_isv.vmwarecloudsimple.virtual_machines.stop
@resource_group_name='{{ resource_group_name }}' --required,
@virtual_machine_name='{{ virtual_machine_name }}' --required,
@subscription_id='{{ subscription_id }}' --required,
@Referer='{{ Referer }}' --required,
@mode='{{ mode }}'
@@json=
'{
"mode": "{{ mode }}"
}'
;