Skip to content

Instantly share code, notes, and snippets.

@ngschmidt
Last active October 30, 2022 16:07
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
VMware Guest OS Provisioning and Customization
---
- hosts: "{{ lookup('env', 'EXEC_HOST') }}"
tasks:
- name: "Disable cloud-init!"
systemd:
name: "{{ item }}"
enabled: "no"
state: "stopped"
loop:
- "cloud-init"
- "cloud-config"
- "cloud-final"
- "cloud-init-local"
{
"info": {
"name": "vSphere REST",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Auth",
"item": [
{
"name": "Get API Key",
"request": {
"auth": {
"type": "basic",
"basic": [
{
"key": "password",
"value": "{{vsphere_password}}",
"type": "string"
},
{
"key": "username",
"value": "{{vsphere_username}}",
"type": "string"
}
]
},
"method": "POST",
"header": [
{
"key": "Accept-Encoding",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "grant_type",
"value": "",
"type": "text"
},
{
"key": "subject_token",
"value": "",
"type": "text"
},
{
"key": "subject_token_type",
"value": "",
"type": "text"
}
]
},
"url": {
"raw": "https://{{vsphere_vcenter}}/api/session",
"protocol": "https",
"host": [
"{{vsphere_vcenter}}"
],
"path": [
"api",
"session"
]
}
},
"response": []
}
]
},
{
"name": "Content Library",
"item": [
{
"name": "Get Content Libraries",
"request": {
"auth": {
"type": "apikey",
"apikey": [
{
"key": "value",
"value": "{{vsphere_key}}",
"type": "string"
},
{
"key": "key",
"value": "vmware-api-session-id",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"url": {
"raw": "https://{{vsphere_vcenter}}/api/content/library",
"protocol": "https",
"host": [
"{{vsphere_vcenter}}"
],
"path": [
"api",
"content",
"library"
]
}
},
"response": [
{
"name": "Get Content Libraries",
"originalRequest": {
"method": "GET",
"header": [],
"url": {
"raw": "https://{{vsphere_vcenter}}/api/content/library",
"protocol": "https",
"host": [
"{{vsphere_vcenter}}"
],
"path": [
"api",
"content",
"library"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "date",
"value": "Sun, 18 Sep 2022 15:11:37 GMT"
},
{
"key": "content-type",
"value": "application/json"
},
{
"key": "x-envoy-upstream-service-time",
"value": "254"
},
{
"key": "server",
"value": "envoy"
},
{
"key": "transfer-encoding",
"value": "chunked"
}
],
"cookie": [],
"body": "[\n \"3007a2d3-4947-4159-ba7d-c9982f8c3ca5\",\n \"4b23b09a-803b-4e16-bf3a-b382e9bbce10\"\n]"
}
]
},
{
"name": "Get Content Library",
"request": {
"auth": {
"type": "apikey",
"apikey": [
{
"key": "value",
"value": "{{vsphere_key}}",
"type": "string"
},
{
"key": "key",
"value": "vmware-api-session-id",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"url": {
"raw": "https://{{vsphere_vcenter}}/api/content/library/{{vsphere_base_images_library}}",
"protocol": "https",
"host": [
"{{vsphere_vcenter}}"
],
"path": [
"api",
"content",
"library",
"{{vsphere_base_images_library}}"
]
}
},
"response": [
{
"name": "Get Content Library",
"originalRequest": {
"method": "GET",
"header": [],
"url": {
"raw": "https://{{vsphere_vcenter}}/api/content/library/{{vsphere_base_images_library}}",
"protocol": "https",
"host": [
"{{vsphere_vcenter}}"
],
"path": [
"api",
"content",
"library",
"{{vsphere_base_images_library}}"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "date",
"value": "Sun, 18 Sep 2022 15:13:30 GMT"
},
{
"key": "content-type",
"value": "application/json"
},
{
"key": "x-envoy-upstream-service-time",
"value": "8"
},
{
"key": "server",
"value": "envoy"
},
{
"key": "transfer-encoding",
"value": "chunked"
}
],
"cookie": [],
"body": "{\n \"creation_time\": \"2020-10-04T00:42:06.849Z\",\n \"storage_backings\": [\n {\n \"datastore_id\": \"datastore-1023\",\n \"type\": \"DATASTORE\"\n }\n ],\n \"last_modified_time\": \"2021-12-20T21:07:14.770Z\",\n \"optimization_info\": {\n \"optimize_remote_publishing\": false\n },\n \"server_guid\": \"2ad3f580-c65e-4698-ac81-d0e102ba5c76\",\n \"description\": \"\",\n \"type\": \"LOCAL\",\n \"version\": \"3\",\n \"name\": \"eng-lab-clib-baseimages\",\n \"publish_info\": {\n \"authentication_method\": \"NONE\",\n \"user_name\": \"vcsp\",\n \"published\": true,\n \"publish_url\": \"https://vcenter.lab.engyak.net:443/cls/vcsp/lib/3007a2d3-4947-4159-ba7d-c9982f8c3ca5/lib.json\",\n \"persist_json_enabled\": false\n },\n \"id\": \"3007a2d3-4947-4159-ba7d-c9982f8c3ca5\"\n}"
}
]
},
{
"name": "Get Content Library Items",
"request": {
"auth": {
"type": "apikey",
"apikey": [
{
"key": "value",
"value": "{{vsphere_key}}",
"type": "string"
},
{
"key": "key",
"value": "vmware-api-session-id",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"url": {
"raw": "https://{{vsphere_vcenter}}/api/content/library/item?library_id={{vsphere_base_images_library}}",
"protocol": "https",
"host": [
"{{vsphere_vcenter}}"
],
"path": [
"api",
"content",
"library",
"item"
],
"query": [
{
"key": "library_id",
"value": "{{vsphere_base_images_library}}"
}
]
}
},
"response": [
{
"name": "Get Content Library Items",
"originalRequest": {
"method": "GET",
"header": [],
"url": {
"raw": "https://{{vsphere_vcenter}}/api/content/library/item?library_id={{vsphere_base_images_library}}",
"protocol": "https",
"host": [
"{{vsphere_vcenter}}"
],
"path": [
"api",
"content",
"library",
"item"
],
"query": [
{
"key": "library_id",
"value": "{{vsphere_base_images_library}}"
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "date",
"value": "Sun, 18 Sep 2022 15:19:14 GMT"
},
{
"key": "content-type",
"value": "application/json"
},
{
"key": "x-envoy-upstream-service-time",
"value": "30"
},
{
"key": "server",
"value": "envoy"
},
{
"key": "transfer-encoding",
"value": "chunked"
}
],
"cookie": [],
"body": "[\n \"db6af96c-3c1d-4285-9cca-904d585ecbe3\",\n \"05886bd8-7389-49e1-a53f-29353cd70186\",\n \"ac6d7f50-0f50-4a1d-b9b5-0e6326f95bb2\",\n \"85d452d2-c55b-4e8c-82ac-99350948d809\"\n]"
}
]
},
{
"name": "Get Content Library Item",
"request": {
"auth": {
"type": "apikey",
"apikey": [
{
"key": "value",
"value": "{{vsphere_key}}",
"type": "string"
},
{
"key": "key",
"value": "vmware-api-session-id",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"url": {
"raw": "https://{{vsphere_vcenter}}/api/content/library/item/{{vsphere_base_images_library_item}}",
"protocol": "https",
"host": [
"{{vsphere_vcenter}}"
],
"path": [
"api",
"content",
"library",
"item",
"{{vsphere_base_images_library_item}}"
]
}
},
"response": [
{
"name": "Get Content Library Items Copy",
"originalRequest": {
"method": "GET",
"header": [],
"url": {
"raw": "https://{{vsphere_vcenter}}/api/content/library/item/{{vsphere_base_images_library_item}}",
"protocol": "https",
"host": [
"{{vsphere_vcenter}}"
],
"path": [
"api",
"content",
"library",
"item",
"{{vsphere_base_images_library_item}}"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "date",
"value": "Sun, 18 Sep 2022 15:22:10 GMT"
},
{
"key": "content-type",
"value": "application/json"
},
{
"key": "x-envoy-upstream-service-time",
"value": "17"
},
{
"key": "server",
"value": "envoy"
},
{
"key": "transfer-encoding",
"value": "chunked"
}
],
"cookie": [],
"body": "{\n \"creation_time\": \"2022-08-14T23:02:57.735Z\",\n \"last_modified_time\": \"2022-08-14T23:13:06.694Z\",\n \"description\": \"\",\n \"type\": \"vm-template\",\n \"version\": \"1\",\n \"content_version\": \"2\",\n \"library_id\": \"3007a2d3-4947-4159-ba7d-c9982f8c3ca5\",\n \"size\": 4049543900,\n \"cached\": true,\n \"name\": \"opensuse-15.4\",\n \"security_compliance\": true,\n \"id\": \"85d452d2-c55b-4e8c-82ac-99350948d809\",\n \"metadata_version\": \"1\"\n}"
}
]
},
{
"name": "Get vCenter Library Items",
"request": {
"auth": {
"type": "apikey",
"apikey": [
{
"key": "value",
"value": "{{vsphere_key}}",
"type": "string"
},
{
"key": "key",
"value": "vmware-api-session-id",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"url": {
"raw": "https://{{vsphere_vcenter}}/api/vcenter/vm-template/library-items/{{vsphere_base_images_library_item}}",
"protocol": "https",
"host": [
"{{vsphere_vcenter}}"
],
"path": [
"api",
"vcenter",
"vm-template",
"library-items",
"{{vsphere_base_images_library_item}}"
]
}
},
"response": [
{
"name": "Get vCenter Library Items",
"originalRequest": {
"method": "GET",
"header": [],
"url": {
"raw": "https://{{vsphere_vcenter}}/api/vcenter/vm-template/library-items/{{vsphere_base_images_library_item}}",
"protocol": "https",
"host": [
"{{vsphere_vcenter}}"
],
"path": [
"api",
"vcenter",
"vm-template",
"library-items",
"{{vsphere_base_images_library_item}}"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "date",
"value": "Sun, 18 Sep 2022 15:26:14 GMT"
},
{
"key": "content-type",
"value": "application/json"
},
{
"key": "x-envoy-upstream-service-time",
"value": "2585"
},
{
"key": "server",
"value": "envoy"
},
{
"key": "transfer-encoding",
"value": "chunked"
}
],
"cookie": [],
"body": "{\n \"memory\": {\n \"size_MiB\": 4096\n },\n \"disks\": {\n \"2000\": {\n \"disk_storage\": {\n \"datastore\": \"datastore-1052\"\n },\n \"capacity\": 53687091200\n }\n },\n \"nics\": {\n \"4000\": {\n \"mac_type\": \"ASSIGNED\",\n \"backing_type\": \"DISTRIBUTED_PORTGROUP\",\n \"network\": \"dvportgroup-1014\"\n }\n },\n \"cpu\": {\n \"count\": 1,\n \"cores_per_socket\": 1\n },\n \"vm_home_storage\": {\n \"datastore\": \"datastore-1052\"\n },\n \"guest_OS\": \"SLES_15_64\",\n \"vm_template\": \"vm-45055\"\n}"
}
]
},
{
"name": "Get vCenter Clusters",
"request": {
"auth": {
"type": "apikey",
"apikey": [
{
"key": "value",
"value": "{{vsphere_key}}",
"type": "string"
},
{
"key": "key",
"value": "vmware-api-session-id",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"url": {
"raw": "https://{{vsphere_vcenter}}/api/vcenter/cluster",
"protocol": "https",
"host": [
"{{vsphere_vcenter}}"
],
"path": [
"api",
"vcenter",
"cluster"
]
}
},
"response": [
{
"name": "Get vCenter Clusters",
"originalRequest": {
"method": "GET",
"header": [],
"url": {
"raw": "https://{{vsphere_vcenter}}/api/vcenter/cluster",
"protocol": "https",
"host": [
"{{vsphere_vcenter}}"
],
"path": [
"api",
"vcenter",
"cluster"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "date",
"value": "Sun, 18 Sep 2022 15:35:25 GMT"
},
{
"key": "content-type",
"value": "application/json"
},
{
"key": "x-envoy-upstream-service-time",
"value": "509"
},
{
"key": "server",
"value": "envoy"
},
{
"key": "transfer-encoding",
"value": "chunked"
}
],
"cookie": [],
"body": "[\n {\n \"drs_enabled\": true,\n \"cluster\": \"domain-c1008\",\n \"name\": \"eng-lab-c01\",\n \"ha_enabled\": true\n }\n]"
}
]
},
{
"name": "Get vCenter Folders",
"request": {
"auth": {
"type": "apikey",
"apikey": [
{
"key": "value",
"value": "{{vsphere_key}}",
"type": "string"
},
{
"key": "key",
"value": "vmware-api-session-id",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"url": {
"raw": "https://{{vsphere_vcenter}}/api/vcenter/folder",
"protocol": "https",
"host": [
"{{vsphere_vcenter}}"
],
"path": [
"api",
"vcenter",
"folder"
]
}
},
"response": []
},
{
"name": "Get vCenter Datastores",
"request": {
"auth": {
"type": "apikey",
"apikey": [
{
"key": "value",
"value": "{{vsphere_key}}",
"type": "string"
},
{
"key": "key",
"value": "vmware-api-session-id",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"url": {
"raw": "https://{{vsphere_vcenter}}/api/vcenter/datastore",
"protocol": "https",
"host": [
"{{vsphere_vcenter}}"
],
"path": [
"api",
"vcenter",
"datastore"
]
}
},
"response": []
},
{
"name": "Deploy Content Library Item",
"request": {
"auth": {
"type": "apikey",
"apikey": [
{
"key": "value",
"value": "{{vsphere_key}}",
"type": "string"
},
{
"key": "key",
"value": "vmware-api-session-id",
"type": "string"
}
]
},
"method": "POST",
"header": [
{
"key": "Accept-Encoding",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"name\": \"fizz_buzz\",\r\n \"disk_storage\": {\r\n \"datastore\": \"{{vsphere_deployment_datastore}}\"\r\n },\r\n \"placement\": {\r\n \"folder\": \"{{vsphere_deployment_folder}}\",\r\n \"cluster\": \"{{vsphere_deployment_cluster}}\"\r\n }\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://{{vsphere_vcenter}}/api/vcenter/vm-template/library-items/{{vsphere_base_images_library_item}}?action=deploy",
"protocol": "https",
"host": [
"{{vsphere_vcenter}}"
],
"path": [
"api",
"vcenter",
"vm-template",
"library-items",
"{{vsphere_base_images_library_item}}"
],
"query": [
{
"key": "action",
"value": "deploy"
}
]
}
},
"response": []
}
]
},
{
"name": "VM Customization",
"item": [
{
"name": "Get Deployed VMs",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"auth": {
"type": "apikey",
"apikey": [
{
"key": "value",
"value": "{{vsphere_key}}",
"type": "string"
},
{
"key": "key",
"value": "vmware-api-session-id",
"type": "string"
}
]
},
"method": "GET",
"header": [
{
"key": "Accept-Encoding",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"name\": \"fizzbuzz\",\r\n \"disk_storage\": {\r\n \"datastore\": \"{{vsphere_deployment_datastore}}\"\r\n },\r\n \"placement\": {\r\n \"folder\": \"{{vsphere_deployment_folder}}\",\r\n \"cluster\": \"{{vsphere_deployment_cluster}}\"\r\n }\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://{{vsphere_vcenter}}/api/vcenter/vm/",
"protocol": "https",
"host": [
"{{vsphere_vcenter}}"
],
"path": [
"api",
"vcenter",
"vm",
""
]
}
},
"response": [
{
"name": "Get Deployed VM",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Accept-Encoding",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"name\": \"fizzbuzz\",\r\n \"disk_storage\": {\r\n \"datastore\": \"{{vsphere_deployment_datastore}}\"\r\n },\r\n \"placement\": {\r\n \"folder\": \"{{vsphere_deployment_folder}}\",\r\n \"cluster\": \"{{vsphere_deployment_cluster}}\"\r\n }\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://{{vsphere_vcenter}}/api/vcenter/vm/{{vsphere_deployed_vm_id}}",
"protocol": "https",
"host": [
"{{vsphere_vcenter}}"
],
"path": [
"api",
"vcenter",
"vm",
"{{vsphere_deployed_vm_id}}"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "date",
"value": "Sun, 18 Sep 2022 16:21:18 GMT"
},
{
"key": "content-type",
"value": "application/json"
},
{
"key": "x-envoy-upstream-service-time",
"value": "3"
},
{
"key": "server",
"value": "envoy"
},
{
"key": "transfer-encoding",
"value": "chunked"
}
],
"cookie": [],
"body": "{\n \"instant_clone_frozen\": false,\n \"cdroms\": {\n \"16000\": {\n \"start_connected\": false,\n \"backing\": {\n \"device_access_type\": \"EMULATION\",\n \"type\": \"CLIENT_DEVICE\"\n },\n \"allow_guest_control\": true,\n \"label\": \"CD/DVD drive 1\",\n \"state\": \"NOT_CONNECTED\",\n \"type\": \"SATA\",\n \"sata\": {\n \"bus\": 0,\n \"unit\": 0\n }\n }\n },\n \"memory\": {\n \"size_MiB\": 4096,\n \"hot_add_enabled\": false\n },\n \"disks\": {\n \"2000\": {\n \"scsi\": {\n \"bus\": 0,\n \"unit\": 0\n },\n \"backing\": {\n \"vmdk_file\": \"[eng-lab-nfs-pyl-liburatt] fizzbuzz/fizzbuzz_3.vmdk\",\n \"type\": \"VMDK_FILE\"\n },\n \"label\": \"Hard disk 1\",\n \"type\": \"SCSI\",\n \"capacity\": 53687091200\n }\n },\n \"parallel_ports\": {},\n \"sata_adapters\": {\n \"15000\": {\n \"bus\": 0,\n \"pci_slot_number\": 32,\n \"label\": \"SATA controller 0\",\n \"type\": \"AHCI\"\n }\n },\n \"cpu\": {\n \"hot_remove_enabled\": false,\n \"count\": 1,\n \"hot_add_enabled\": false,\n \"cores_per_socket\": 1\n },\n \"scsi_adapters\": {\n \"1000\": {\n \"pci_slot_number\": 160,\n \"scsi\": {\n \"bus\": 0,\n \"unit\": 7\n },\n \"label\": \"SCSI controller 0\",\n \"sharing\": \"NONE\",\n \"type\": \"PVSCSI\"\n }\n },\n \"power_state\": \"POWERED_OFF\",\n \"floppies\": {},\n \"identity\": {\n \"name\": \"fizzbuzz\",\n \"instance_uuid\": \"503ca2e3-1963-1b10-4174-fdb3c76c4af9\",\n \"bios_uuid\": \"423c5f2c-2e3c-8a71-c2c4-d0a9f6c29b2d\"\n },\n \"nvme_adapters\": {},\n \"name\": \"fizzbuzz\",\n \"nics\": {\n \"4000\": {\n \"start_connected\": true,\n \"pci_slot_number\": 192,\n \"backing\": {\n \"connection_cookie\": 1818933134,\n \"distributed_port\": \"168\",\n \"distributed_switch_uuid\": \"50 3c d8 d9 e6 81 9e f6-43 dc d6 86 49 2e de 38\",\n \"type\": \"DISTRIBUTED_PORTGROUP\",\n \"network\": \"dvportgroup-1014\"\n },\n \"mac_address\": \"00:50:56:bc:f0:dd\",\n \"mac_type\": \"ASSIGNED\",\n \"allow_guest_control\": true,\n \"wake_on_lan_enabled\": true,\n \"label\": \"Network adapter 1\",\n \"state\": \"NOT_CONNECTED\",\n \"type\": \"VMXNET3\",\n \"upt_compatibility_enabled\": true\n }\n },\n \"boot\": {\n \"delay\": 0,\n \"efi_legacy_boot\": false,\n \"retry_delay\": 10000,\n \"enter_setup_mode\": false,\n \"network_protocol\": \"IPV4\",\n \"type\": \"EFI\",\n \"retry\": false\n },\n \"serial_ports\": {},\n \"boot_devices\": [],\n \"guest_OS\": \"SLES_15_64\",\n \"hardware\": {\n \"upgrade_policy\": \"NEVER\",\n \"upgrade_status\": \"NONE\",\n \"version\": \"VMX_19\"\n }\n}"
}
]
},
{
"name": "Get Deployed VM",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"auth": {
"type": "apikey",
"apikey": [
{
"key": "value",
"value": "{{vsphere_key}}",
"type": "string"
},
{
"key": "key",
"value": "vmware-api-session-id",
"type": "string"
}
]
},
"method": "GET",
"header": [
{
"key": "Accept-Encoding",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"name\": \"fizzbuzz\",\r\n \"disk_storage\": {\r\n \"datastore\": \"{{vsphere_deployment_datastore}}\"\r\n },\r\n \"placement\": {\r\n \"folder\": \"{{vsphere_deployment_folder}}\",\r\n \"cluster\": \"{{vsphere_deployment_cluster}}\"\r\n }\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://{{vsphere_vcenter}}/api/vcenter/vm/{{vsphere_deployed_vm_id}}",
"protocol": "https",
"host": [
"{{vsphere_vcenter}}"
],
"path": [
"api",
"vcenter",
"vm",
"{{vsphere_deployed_vm_id}}"
]
}
},
"response": [
{
"name": "Get Deployed VM",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Accept-Encoding",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"name\": \"fizzbuzz\",\r\n \"disk_storage\": {\r\n \"datastore\": \"{{vsphere_deployment_datastore}}\"\r\n },\r\n \"placement\": {\r\n \"folder\": \"{{vsphere_deployment_folder}}\",\r\n \"cluster\": \"{{vsphere_deployment_cluster}}\"\r\n }\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://{{vsphere_vcenter}}/api/vcenter/vm/{{vsphere_deployed_vm_id}}",
"protocol": "https",
"host": [
"{{vsphere_vcenter}}"
],
"path": [
"api",
"vcenter",
"vm",
"{{vsphere_deployed_vm_id}}"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "date",
"value": "Sun, 18 Sep 2022 16:21:18 GMT"
},
{
"key": "content-type",
"value": "application/json"
},
{
"key": "x-envoy-upstream-service-time",
"value": "3"
},
{
"key": "server",
"value": "envoy"
},
{
"key": "transfer-encoding",
"value": "chunked"
}
],
"cookie": [],
"body": "{\n \"instant_clone_frozen\": false,\n \"cdroms\": {\n \"16000\": {\n \"start_connected\": false,\n \"backing\": {\n \"device_access_type\": \"EMULATION\",\n \"type\": \"CLIENT_DEVICE\"\n },\n \"allow_guest_control\": true,\n \"label\": \"CD/DVD drive 1\",\n \"state\": \"NOT_CONNECTED\",\n \"type\": \"SATA\",\n \"sata\": {\n \"bus\": 0,\n \"unit\": 0\n }\n }\n },\n \"memory\": {\n \"size_MiB\": 4096,\n \"hot_add_enabled\": false\n },\n \"disks\": {\n \"2000\": {\n \"scsi\": {\n \"bus\": 0,\n \"unit\": 0\n },\n \"backing\": {\n \"vmdk_file\": \"[eng-lab-nfs-pyl-liburatt] fizzbuzz/fizzbuzz_3.vmdk\",\n \"type\": \"VMDK_FILE\"\n },\n \"label\": \"Hard disk 1\",\n \"type\": \"SCSI\",\n \"capacity\": 53687091200\n }\n },\n \"parallel_ports\": {},\n \"sata_adapters\": {\n \"15000\": {\n \"bus\": 0,\n \"pci_slot_number\": 32,\n \"label\": \"SATA controller 0\",\n \"type\": \"AHCI\"\n }\n },\n \"cpu\": {\n \"hot_remove_enabled\": false,\n \"count\": 1,\n \"hot_add_enabled\": false,\n \"cores_per_socket\": 1\n },\n \"scsi_adapters\": {\n \"1000\": {\n \"pci_slot_number\": 160,\n \"scsi\": {\n \"bus\": 0,\n \"unit\": 7\n },\n \"label\": \"SCSI controller 0\",\n \"sharing\": \"NONE\",\n \"type\": \"PVSCSI\"\n }\n },\n \"power_state\": \"POWERED_OFF\",\n \"floppies\": {},\n \"identity\": {\n \"name\": \"fizzbuzz\",\n \"instance_uuid\": \"503ca2e3-1963-1b10-4174-fdb3c76c4af9\",\n \"bios_uuid\": \"423c5f2c-2e3c-8a71-c2c4-d0a9f6c29b2d\"\n },\n \"nvme_adapters\": {},\n \"name\": \"fizzbuzz\",\n \"nics\": {\n \"4000\": {\n \"start_connected\": true,\n \"pci_slot_number\": 192,\n \"backing\": {\n \"connection_cookie\": 1818933134,\n \"distributed_port\": \"168\",\n \"distributed_switch_uuid\": \"50 3c d8 d9 e6 81 9e f6-43 dc d6 86 49 2e de 38\",\n \"type\": \"DISTRIBUTED_PORTGROUP\",\n \"network\": \"dvportgroup-1014\"\n },\n \"mac_address\": \"00:50:56:bc:f0:dd\",\n \"mac_type\": \"ASSIGNED\",\n \"allow_guest_control\": true,\n \"wake_on_lan_enabled\": true,\n \"label\": \"Network adapter 1\",\n \"state\": \"NOT_CONNECTED\",\n \"type\": \"VMXNET3\",\n \"upt_compatibility_enabled\": true\n }\n },\n \"boot\": {\n \"delay\": 0,\n \"efi_legacy_boot\": false,\n \"retry_delay\": 10000,\n \"enter_setup_mode\": false,\n \"network_protocol\": \"IPV4\",\n \"type\": \"EFI\",\n \"retry\": false\n },\n \"serial_ports\": {},\n \"boot_devices\": [],\n \"guest_OS\": \"SLES_15_64\",\n \"hardware\": {\n \"upgrade_policy\": \"NEVER\",\n \"upgrade_status\": \"NONE\",\n \"version\": \"VMX_19\"\n }\n}"
}
]
},
{
"name": "Get VM Power Status",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"auth": {
"type": "apikey",
"apikey": [
{
"key": "value",
"value": "{{vsphere_key}}",
"type": "string"
},
{
"key": "key",
"value": "vmware-api-session-id",
"type": "string"
}
]
},
"method": "GET",
"header": [
{
"key": "Accept-Encoding",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"spec\": {\r\n\t\t\"configuration_spec\": {\r\n\t\t\t\"cloud_config\": {\r\n\t\t\t\t\"cloudinit\": {\r\n\t\t\t\t\t\"metadata\": \"fizz\",\r\n\t\t\t\t\t\"userdata\": \"buzz\"\r\n\t\t\t\t},\r\n\t\t\t\t\"type\": \"CLOUDINIT\"\r\n\t\t\t},\r\n\t\t\t\"linux_config\": {\r\n\t\t\t\t\"domain\": \"{{vsphere_dns_suffix}}\",\r\n\t\t\t\t\"hostname\": {\r\n\t\t\t\t\t\"prefix\": \"fizzbuzz\",\r\n\t\t\t\t\t\"type\": \"PREFIX\"\r\n\t\t\t\t},\r\n\t\t\t\t\"script_text\": \"echo 'fizzbuzz wuzz here' >> /etc/tree\",\r\n\t\t\t\t\"time_zone\": \"{{vsphere_timezone}}\"\r\n\t\t\t}\r\n\t\t},\r\n\t\t\"global_DNS_settings\": {\r\n\t\t\t\"dns_servers\": [\r\n\t\t\t\t\"{{vsphere_dns_servers}}\"\r\n\t\t\t],\r\n\t\t\t\"dns_suffix_list\": [\r\n\t\t\t\t\"{{vsphere_dns_suffix}}\"\r\n\t\t\t]\r\n\t\t},\r\n\t\t\"interfaces\": [\r\n\t\t\t{\r\n\t\t\t\t\"adapter\": {\r\n\t\t\t\t\t\"ipv4\": {\r\n\t\t\t\t\t\t\"gateways\": [\r\n\t\t\t\t\t\t\t\"{{vsphere_ip_gateway}}\"\r\n\t\t\t\t\t\t],\r\n\t\t\t\t\t\t\"ip_address\": \"{{vsphere_ip_intf}}\",\r\n\t\t\t\t\t\t\"prefix\": {{vsphere_ip_netmask}},\r\n\t\t\t\t\t\t\"type\": \"STATIC\"\r\n\t\t\t\t\t},\r\n\t\t\t\t\t\"ipv6\": {\r\n \"gateways\": [\r\n \"{{vsphere_ipv6_gateway}}\"\r\n ],\r\n \"ipv6\": [\r\n {\r\n \"ip_address\": \"{{vsphere_ipv6_intf}}\",\r\n \"prefix\": \"{{vsphere_ipv6_netmask}}\"\r\n }\r\n ],\r\n\t\t\t\t\t\t\"type\": \"STATIC\"\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t]\r\n\t}\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://{{vsphere_vcenter}}/api/vcenter/vm/{{vsphere_deployed_vm_id}}/power",
"protocol": "https",
"host": [
"{{vsphere_vcenter}}"
],
"path": [
"api",
"vcenter",
"vm",
"{{vsphere_deployed_vm_id}}",
"power"
]
}
},
"response": [
{
"name": "Get VM Power Status",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Accept-Encoding",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"spec\": {\r\n\t\t\"configuration_spec\": {\r\n\t\t\t\"cloud_config\": {\r\n\t\t\t\t\"cloudinit\": {\r\n\t\t\t\t\t\"metadata\": \"fizz\",\r\n\t\t\t\t\t\"userdata\": \"buzz\"\r\n\t\t\t\t},\r\n\t\t\t\t\"type\": \"CLOUDINIT\"\r\n\t\t\t},\r\n\t\t\t\"linux_config\": {\r\n\t\t\t\t\"domain\": \"{{vsphere_dns_suffix}}\",\r\n\t\t\t\t\"hostname\": {\r\n\t\t\t\t\t\"prefix\": \"fizzbuzz\",\r\n\t\t\t\t\t\"type\": \"PREFIX\"\r\n\t\t\t\t},\r\n\t\t\t\t\"script_text\": \"echo 'fizzbuzz wuzz here' >> /etc/tree\",\r\n\t\t\t\t\"time_zone\": \"{{vsphere_timezone}}\"\r\n\t\t\t}\r\n\t\t},\r\n\t\t\"global_DNS_settings\": {\r\n\t\t\t\"dns_servers\": [\r\n\t\t\t\t\"{{vsphere_dns_servers}}\"\r\n\t\t\t],\r\n\t\t\t\"dns_suffix_list\": [\r\n\t\t\t\t\"{{vsphere_dns_suffix}}\"\r\n\t\t\t]\r\n\t\t},\r\n\t\t\"interfaces\": [\r\n\t\t\t{\r\n\t\t\t\t\"adapter\": {\r\n\t\t\t\t\t\"ipv4\": {\r\n\t\t\t\t\t\t\"gateways\": [\r\n\t\t\t\t\t\t\t\"{{vsphere_ip_gateway}}\"\r\n\t\t\t\t\t\t],\r\n\t\t\t\t\t\t\"ip_address\": \"{{vsphere_ip_intf}}\",\r\n\t\t\t\t\t\t\"prefix\": {{vsphere_ip_netmask}},\r\n\t\t\t\t\t\t\"type\": \"STATIC\"\r\n\t\t\t\t\t},\r\n\t\t\t\t\t\"ipv6\": {\r\n \"gateways\": [\r\n \"{{vsphere_ipv6_gateway}}\"\r\n ],\r\n \"ipv6\": [\r\n {\r\n \"ip_address\": \"{{vsphere_ipv6_intf}}\",\r\n \"prefix\": \"{{vsphere_ipv6_netmask}}\"\r\n }\r\n ],\r\n\t\t\t\t\t\t\"type\": \"STATIC\"\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t]\r\n\t}\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://{{vsphere_vcenter}}/api/vcenter/vm/{{vsphere_deployed_vm_id}}/power",
"protocol": "https",
"host": [
"{{vsphere_vcenter}}"
],
"path": [
"api",
"vcenter",
"vm",
"{{vsphere_deployed_vm_id}}",
"power"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "date",
"value": "Sun, 18 Sep 2022 16:45:52 GMT"
},
{
"key": "content-type",
"value": "application/json"
},
{
"key": "x-envoy-upstream-service-time",
"value": "428"
},
{
"key": "server",
"value": "envoy"
},
{
"key": "transfer-encoding",
"value": "chunked"
}
],
"cookie": [],
"body": "{\n \"state\": \"POWERED_ON\"\n}"
}
]
},
{
"name": "Customize Deployed VM (Metadata Method)",
"request": {
"auth": {
"type": "apikey",
"apikey": [
{
"key": "value",
"value": "{{vsphere_key}}",
"type": "string"
},
{
"key": "key",
"value": "vmware-api-session-id",
"type": "string"
}
]
},
"method": "PUT",
"header": [
{
"key": "Accept-Encoding",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"spec\": {\r\n\t\t\"configuration_spec\": {\r\n\t\t\t\"cloud_config\": {\r\n\t\t\t\t\"cloudinit\": {\r\n\t\t\t\t\t\"metadata\": \"\",\r\n \"userdata\": \"\"\r\n\t\t\t\t},\r\n\t\t\t\t\"type\": \"CLOUDINIT\"\r\n\t\t\t}\r\n\t\t},\r\n\t\t\"global_DNS_settings\": {\r\n\t\t\t\"dns_servers\": [\r\n\t\t\t\t\"{{vsphere_dns_servers}}\"\r\n\t\t\t],\r\n\t\t\t\"dns_suffix_list\": [\r\n\t\t\t\t\"{{vsphere_dns_suffix}}\"\r\n\t\t\t]\r\n\t\t},\r\n\t\t\"interfaces\": [\r\n\t\t\t{\r\n\t\t\t\t\"adapter\": {\r\n\t\t\t\t\t\"ipv4\": {\r\n\t\t\t\t\t\t\"gateways\": [\r\n\t\t\t\t\t\t\t\"{{vsphere_ip_gateway}}\"\r\n\t\t\t\t\t\t],\r\n\t\t\t\t\t\t\"ip_address\": \"{{vsphere_ip_intf}}\",\r\n\t\t\t\t\t\t\"prefix\": {{vsphere_ip_netmask}},\r\n\t\t\t\t\t\t\"type\": \"STATIC\"\r\n\t\t\t\t\t},\r\n\t\t\t\t\t\"ipv6\": {\r\n \"gateways\": [\r\n \"{{vsphere_ipv6_gateway}}\"\r\n ],\r\n \"ipv6\": [\r\n {\r\n \"ip_address\": \"{{vsphere_ipv6_intf}}\",\r\n \"prefix\": \"{{vsphere_ipv6_netmask}}\"\r\n }\r\n ],\r\n\t\t\t\t\t\t\"type\": \"STATIC\"\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t]\r\n\t}\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://{{vsphere_vcenter}}/api/vcenter/vm/{{vsphere_deployed_vm_id}}/guest/customization",
"protocol": "https",
"host": [
"{{vsphere_vcenter}}"
],
"path": [
"api",
"vcenter",
"vm",
"{{vsphere_deployed_vm_id}}",
"guest",
"customization"
]
}
},
"response": [
{
"name": "Customize Deployed VM",
"originalRequest": {
"method": "PUT",
"header": [
{
"key": "Accept-Encoding",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"spec\": {\r\n\t\t\"configuration_spec\": {\r\n\t\t\t\"cloud_config\": {\r\n\t\t\t\t\"cloudinit\": {\r\n\t\t\t\t\t\"metadata\": \"fizz\",\r\n\t\t\t\t\t\"userdata\": \"buzz\"\r\n\t\t\t\t},\r\n\t\t\t\t\"type\": \"CLOUDINIT\"\r\n\t\t\t},\r\n\t\t\t\"linux_config\": {\r\n\t\t\t\t\"domain\": \"{{vsphere_dns_suffix}}\",\r\n\t\t\t\t\"hostname\": {\r\n\t\t\t\t\t\"prefix\": \"fizzbuzz\",\r\n\t\t\t\t\t\"type\": \"PREFIX\"\r\n\t\t\t\t},\r\n\t\t\t\t\"script_text\": \"echo 'fizzbuzz wuzz here' >> /etc/tree\",\r\n\t\t\t\t\"time_zone\": \"{{vsphere_timezone}}\"\r\n\t\t\t}\r\n\t\t},\r\n\t\t\"global_DNS_settings\": {\r\n\t\t\t\"dns_servers\": [\r\n\t\t\t\t\"{{vsphere_dns_servers}}\"\r\n\t\t\t],\r\n\t\t\t\"dns_suffix_list\": [\r\n\t\t\t\t\"{{vsphere_dns_suffix}}\"\r\n\t\t\t]\r\n\t\t},\r\n\t\t\"interfaces\": [\r\n\t\t\t{\r\n\t\t\t\t\"adapter\": {\r\n\t\t\t\t\t\"ipv4\": {\r\n\t\t\t\t\t\t\"gateways\": [\r\n\t\t\t\t\t\t\t\"{{vsphere_ip_gateway}}\"\r\n\t\t\t\t\t\t],\r\n\t\t\t\t\t\t\"ip_address\": \"{{vsphere_ip_intf}}\",\r\n\t\t\t\t\t\t\"prefix\": {{vsphere_ip_netmask}},\r\n\t\t\t\t\t\t\"type\": \"STATIC\"\r\n\t\t\t\t\t},\r\n\t\t\t\t\t\"ipv6\": {\r\n \"gateways\": [\r\n \"{{vsphere_ipv6_gateway}}\"\r\n ],\r\n \"ipv6\": [\r\n {\r\n \"ip_address\": \"{{vsphere_ipv6_intf}}\",\r\n \"prefix\": \"{{vsphere_ipv6_netmask}}\"\r\n }\r\n ],\r\n\t\t\t\t\t\t\"type\": \"STATIC\"\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t]\r\n\t}\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://{{vsphere_vcenter}}/api/vcenter/vm/{{vsphere_deployed_vm_id}}/guest/customization",
"protocol": "https",
"host": [
"{{vsphere_vcenter}}"
],
"path": [
"api",
"vcenter",
"vm",
"{{vsphere_deployed_vm_id}}",
"guest",
"customization"
]
}
},
"status": "No Content",
"code": 204,
"_postman_previewlanguage": "plain",
"header": [
{
"key": "date",
"value": "Sun, 18 Sep 2022 16:43:09 GMT"
},
{
"key": "x-envoy-upstream-service-time",
"value": "794"
},
{
"key": "server",
"value": "envoy"
}
],
"cookie": [],
"body": null
}
]
},
{
"name": "Customize Deployed VM (OVF Method)",
"request": {
"auth": {
"type": "apikey",
"apikey": [
{
"key": "value",
"value": "{{vsphere_key}}",
"type": "string"
},
{
"key": "key",
"value": "vmware-api-session-id",
"type": "string"
}
]
},
"method": "PUT",
"header": [
{
"key": "Accept-Encoding",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"spec\": {\r\n\t\t\"configuration_spec\": {\r\n\t\t\t\"linux_config\": {\r\n\t\t\t\t\"domain\": \"{{vsphere_dns_suffix}}\",\r\n \"hostname\": {\r\n \"fixed_name\": \"fizzbuzzfizz\",\r\n \"type\": \"FIXED\"\r\n },\r\n \"time_zone\": \"{{vsphere_timezone}}\"\r\n\t\t\t}\r\n\t\t},\r\n\t\t\"global_DNS_settings\": {\r\n\t\t\t\"dns_servers\": [\r\n\t\t\t\t\"{{vsphere_dns_servers}}\"\r\n\t\t\t],\r\n\t\t\t\"dns_suffix_list\": [\r\n\t\t\t\t\"{{vsphere_dns_suffix}}\"\r\n\t\t\t]\r\n\t\t},\r\n\t\t\"interfaces\": [\r\n\t\t\t{\r\n\t\t\t\t\"adapter\": {\r\n\t\t\t\t\t\"ipv4\": {\r\n\t\t\t\t\t\t\"gateways\": [\r\n\t\t\t\t\t\t\t\"{{vsphere_ip_gateway}}\"\r\n\t\t\t\t\t\t],\r\n\t\t\t\t\t\t\"ip_address\": \"{{vsphere_ip_intf}}\",\r\n\t\t\t\t\t\t\"prefix\": {{vsphere_ip_netmask}},\r\n\t\t\t\t\t\t\"type\": \"STATIC\"\r\n\t\t\t\t\t},\r\n\t\t\t\t\t\"ipv6\": {\r\n \"gateways\": [\r\n \"{{vsphere_ipv6_gateway}}\"\r\n ],\r\n \"ipv6\": [\r\n {\r\n \"ip_address\": \"{{vsphere_ipv6_intf}}\",\r\n \"prefix\": \"{{vsphere_ipv6_netmask}}\"\r\n }\r\n ],\r\n\t\t\t\t\t\t\"type\": \"STATIC\"\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t]\r\n\t}\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://{{vsphere_vcenter}}/api/vcenter/vm/{{vsphere_deployed_vm_id}}/guest/customization",
"protocol": "https",
"host": [
"{{vsphere_vcenter}}"
],
"path": [
"api",
"vcenter",
"vm",
"{{vsphere_deployed_vm_id}}",
"guest",
"customization"
]
}
},
"response": [
{
"name": "Customize Deployed VM",
"originalRequest": {
"method": "PUT",
"header": [
{
"key": "Accept-Encoding",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"spec\": {\r\n\t\t\"configuration_spec\": {\r\n\t\t\t\"cloud_config\": {\r\n\t\t\t\t\"cloudinit\": {\r\n\t\t\t\t\t\"metadata\": \"fizz\",\r\n\t\t\t\t\t\"userdata\": \"buzz\"\r\n\t\t\t\t},\r\n\t\t\t\t\"type\": \"CLOUDINIT\"\r\n\t\t\t},\r\n\t\t\t\"linux_config\": {\r\n\t\t\t\t\"domain\": \"{{vsphere_dns_suffix}}\",\r\n\t\t\t\t\"hostname\": {\r\n\t\t\t\t\t\"prefix\": \"fizzbuzz\",\r\n\t\t\t\t\t\"type\": \"PREFIX\"\r\n\t\t\t\t},\r\n\t\t\t\t\"script_text\": \"echo 'fizzbuzz wuzz here' >> /etc/tree\",\r\n\t\t\t\t\"time_zone\": \"{{vsphere_timezone}}\"\r\n\t\t\t}\r\n\t\t},\r\n\t\t\"global_DNS_settings\": {\r\n\t\t\t\"dns_servers\": [\r\n\t\t\t\t\"{{vsphere_dns_servers}}\"\r\n\t\t\t],\r\n\t\t\t\"dns_suffix_list\": [\r\n\t\t\t\t\"{{vsphere_dns_suffix}}\"\r\n\t\t\t]\r\n\t\t},\r\n\t\t\"interfaces\": [\r\n\t\t\t{\r\n\t\t\t\t\"adapter\": {\r\n\t\t\t\t\t\"ipv4\": {\r\n\t\t\t\t\t\t\"gateways\": [\r\n\t\t\t\t\t\t\t\"{{vsphere_ip_gateway}}\"\r\n\t\t\t\t\t\t],\r\n\t\t\t\t\t\t\"ip_address\": \"{{vsphere_ip_intf}}\",\r\n\t\t\t\t\t\t\"prefix\": {{vsphere_ip_netmask}},\r\n\t\t\t\t\t\t\"type\": \"STATIC\"\r\n\t\t\t\t\t},\r\n\t\t\t\t\t\"ipv6\": {\r\n \"gateways\": [\r\n \"{{vsphere_ipv6_gateway}}\"\r\n ],\r\n \"ipv6\": [\r\n {\r\n \"ip_address\": \"{{vsphere_ipv6_intf}}\",\r\n \"prefix\": \"{{vsphere_ipv6_netmask}}\"\r\n }\r\n ],\r\n\t\t\t\t\t\t\"type\": \"STATIC\"\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t]\r\n\t}\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://{{vsphere_vcenter}}/api/vcenter/vm/{{vsphere_deployed_vm_id}}/guest/customization",
"protocol": "https",
"host": [
"{{vsphere_vcenter}}"
],
"path": [
"api",
"vcenter",
"vm",
"{{vsphere_deployed_vm_id}}",
"guest",
"customization"
]
}
},
"status": "No Content",
"code": 204,
"_postman_previewlanguage": "plain",
"header": [
{
"key": "date",
"value": "Sun, 18 Sep 2022 16:43:09 GMT"
},
{
"key": "x-envoy-upstream-service-time",
"value": "794"
},
{
"key": "server",
"value": "envoy"
}
],
"cookie": [],
"body": null
}
]
},
{
"name": "Start VM",
"request": {
"auth": {
"type": "apikey",
"apikey": [
{
"key": "value",
"value": "{{vsphere_key}}",
"type": "string"
},
{
"key": "key",
"value": "vmware-api-session-id",
"type": "string"
}
]
},
"method": "POST",
"header": [
{
"key": "Accept-Encoding",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"spec\": {\r\n\t\t\"configuration_spec\": {\r\n\t\t\t\"cloud_config\": {\r\n\t\t\t\t\"cloudinit\": {\r\n\t\t\t\t\t\"metadata\": \"fizz\",\r\n\t\t\t\t\t\"userdata\": \"buzz\"\r\n\t\t\t\t},\r\n\t\t\t\t\"type\": \"CLOUDINIT\"\r\n\t\t\t},\r\n\t\t\t\"linux_config\": {\r\n\t\t\t\t\"domain\": \"{{vsphere_dns_suffix}}\",\r\n\t\t\t\t\"hostname\": {\r\n\t\t\t\t\t\"prefix\": \"fizzbuzz\",\r\n\t\t\t\t\t\"type\": \"PREFIX\"\r\n\t\t\t\t},\r\n\t\t\t\t\"script_text\": \"echo 'fizzbuzz wuzz here' >> /etc/tree\",\r\n\t\t\t\t\"time_zone\": \"{{vsphere_timezone}}\"\r\n\t\t\t}\r\n\t\t},\r\n\t\t\"global_DNS_settings\": {\r\n\t\t\t\"dns_servers\": [\r\n\t\t\t\t\"{{vsphere_dns_servers}}\"\r\n\t\t\t],\r\n\t\t\t\"dns_suffix_list\": [\r\n\t\t\t\t\"{{vsphere_dns_suffix}}\"\r\n\t\t\t]\r\n\t\t},\r\n\t\t\"interfaces\": [\r\n\t\t\t{\r\n\t\t\t\t\"adapter\": {\r\n\t\t\t\t\t\"ipv4\": {\r\n\t\t\t\t\t\t\"gateways\": [\r\n\t\t\t\t\t\t\t\"{{vsphere_ip_gateway}}\"\r\n\t\t\t\t\t\t],\r\n\t\t\t\t\t\t\"ip_address\": \"{{vsphere_ip_intf}}\",\r\n\t\t\t\t\t\t\"prefix\": {{vsphere_ip_netmask}},\r\n\t\t\t\t\t\t\"type\": \"STATIC\"\r\n\t\t\t\t\t},\r\n\t\t\t\t\t\"ipv6\": {\r\n \"gateways\": [\r\n \"{{vsphere_ipv6_gateway}}\"\r\n ],\r\n \"ipv6\": [\r\n {\r\n \"ip_address\": \"{{vsphere_ipv6_intf}}\",\r\n \"prefix\": \"{{vsphere_ipv6_netmask}}\"\r\n }\r\n ],\r\n\t\t\t\t\t\t\"type\": \"STATIC\"\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t]\r\n\t}\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://{{vsphere_vcenter}}/api/vcenter/vm/{{vsphere_deployed_vm_id}}/power?action=start",
"protocol": "https",
"host": [
"{{vsphere_vcenter}}"
],
"path": [
"api",
"vcenter",
"vm",
"{{vsphere_deployed_vm_id}}",
"power"
],
"query": [
{
"key": "action",
"value": "start"
}
]
}
},
"response": []
},
{
"name": "Shutdown VM",
"request": {
"auth": {
"type": "apikey",
"apikey": [
{
"key": "value",
"value": "{{vsphere_key}}",
"type": "string"
},
{
"key": "key",
"value": "vmware-api-session-id",
"type": "string"
}
]
},
"method": "POST",
"header": [
{
"key": "Accept-Encoding",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"spec\": {\r\n\t\t\"configuration_spec\": {\r\n\t\t\t\"cloud_config\": {\r\n\t\t\t\t\"cloudinit\": {\r\n\t\t\t\t\t\"metadata\": \"fizz\",\r\n\t\t\t\t\t\"userdata\": \"buzz\"\r\n\t\t\t\t},\r\n\t\t\t\t\"type\": \"CLOUDINIT\"\r\n\t\t\t},\r\n\t\t\t\"linux_config\": {\r\n\t\t\t\t\"domain\": \"{{vsphere_dns_suffix}}\",\r\n\t\t\t\t\"hostname\": {\r\n\t\t\t\t\t\"prefix\": \"fizzbuzz\",\r\n\t\t\t\t\t\"type\": \"PREFIX\"\r\n\t\t\t\t},\r\n\t\t\t\t\"script_text\": \"echo 'fizzbuzz wuzz here' >> /etc/tree\",\r\n\t\t\t\t\"time_zone\": \"{{vsphere_timezone}}\"\r\n\t\t\t}\r\n\t\t},\r\n\t\t\"global_DNS_settings\": {\r\n\t\t\t\"dns_servers\": [\r\n\t\t\t\t\"{{vsphere_dns_servers}}\"\r\n\t\t\t],\r\n\t\t\t\"dns_suffix_list\": [\r\n\t\t\t\t\"{{vsphere_dns_suffix}}\"\r\n\t\t\t]\r\n\t\t},\r\n\t\t\"interfaces\": [\r\n\t\t\t{\r\n\t\t\t\t\"adapter\": {\r\n\t\t\t\t\t\"ipv4\": {\r\n\t\t\t\t\t\t\"gateways\": [\r\n\t\t\t\t\t\t\t\"{{vsphere_ip_gateway}}\"\r\n\t\t\t\t\t\t],\r\n\t\t\t\t\t\t\"ip_address\": \"{{vsphere_ip_intf}}\",\r\n\t\t\t\t\t\t\"prefix\": {{vsphere_ip_netmask}},\r\n\t\t\t\t\t\t\"type\": \"STATIC\"\r\n\t\t\t\t\t},\r\n\t\t\t\t\t\"ipv6\": {\r\n \"gateways\": [\r\n \"{{vsphere_ipv6_gateway}}\"\r\n ],\r\n \"ipv6\": [\r\n {\r\n \"ip_address\": \"{{vsphere_ipv6_intf}}\",\r\n \"prefix\": \"{{vsphere_ipv6_netmask}}\"\r\n }\r\n ],\r\n\t\t\t\t\t\t\"type\": \"STATIC\"\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t]\r\n\t}\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://{{vsphere_vcenter}}/api/vcenter/vm/{{vsphere_deployed_vm_id}}/guest/power?action=shutdown",
"protocol": "https",
"host": [
"{{vsphere_vcenter}}"
],
"path": [
"api",
"vcenter",
"vm",
"{{vsphere_deployed_vm_id}}",
"guest",
"power"
],
"query": [
{
"key": "action",
"value": "shutdown"
}
]
}
},
"response": []
}
]
}
]
}
{
"id": "",
"name": "vSphere",
"values": [
{
"key": "vsphere_username",
"value": "",
"type": "default",
"enabled": true
},
{
"key": "vsphere_password",
"value": "",
"type": "secret",
"enabled": true
},
{
"key": "vsphere_vcenter",
"value": "",
"type": "default",
"enabled": true
},
{
"key": "vsphere_key",
"value": "",
"type": "secret",
"enabled": true
},
{
"key": "vsphere_base_images_library",
"value": "",
"type": "secret",
"enabled": true
},
{
"key": "vsphere_base_images_library_item",
"value": "",
"type": "secret",
"enabled": true
},
{
"key": "vsphere_deployment_cluster",
"value": "",
"type": "secret",
"enabled": true
},
{
"key": "vsphere_deployment_folder",
"value": "",
"type": "secret",
"enabled": true
},
{
"key": "vsphere_deployment_datastore",
"value": "",
"type": "secret",
"enabled": true
},
{
"key": "vsphere_deployed_vm_id",
"value": "",
"type": "secret",
"enabled": true
},
{
"key": "vsphere_dns_servers",
"value": "",
"type": "secret",
"enabled": true
},
{
"key": "vsphere_dns_suffix",
"value": "",
"type": "secret",
"enabled": true
},
{
"key": "vsphere_ip_gateway",
"value": "",
"type": "default",
"enabled": true
},
{
"key": "vsphere_ip_netmask",
"value": "24",
"type": "default",
"enabled": true
},
{
"key": "vsphere_ip_intf",
"value": "",
"type": "default",
"enabled": true
},
{
"key": "vsphere_ipv6_gateway",
"value": "",
"type": "default",
"enabled": true
},
{
"key": "vsphere_ipv6_netmask",
"value": "64",
"type": "default",
"enabled": true
},
{
"key": "vsphere_ipv6_intf",
"value": "",
"type": "default",
"enabled": true
},
{
"key": "vsphere_timezone",
"value": "",
"type": "default",
"enabled": true
}
],
"_postman_variable_scope": "environment"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment