Problem: Need to provision VMware VM from Template using the Foreman API or CLI - any advice would be appreciated.
Expected outcome: Complete VM build after hitting the API / executing CLI command/script.
Foreman and Proxy versions: 1.19
Foreman and Proxy plugin versions:
Other relevant data:
VMs are successfully provisioned via the Foreman web interface, need to automate this by calling the API or possibly the CLI if necessary.
TheForeman is running on Ubuntu 16.4 and has DHCP & DNS running locally and managed.
Below is the production.log entry from the VM being successfully created:
2018-12-22T15:49:27 [I|app|17b79] Parameters: {“utf8”=>“✓”, “authenticity_token”=>“hlBreSRRWzOZrzr89knTdcedtJ8awAgUxP02Sf5VWz8eUDgEBtw8g57jwBeYMI7/A5LtnK6HXguu7Qz0sQXa5A==”, “host”=>{“name”=>“k8sworker3”, “hostgroup_id”=>“1”, “puppetclass_ids”=>[“”], “managed”=>“true”, “progress_report_id”=>“[FILTERED]”, “type”=>“Host::Managed”, “interfaces_attributes”=>{“0”=>{“_destroy”=>“0”, “type”=>“Nic::Managed”, “mac”=>“”, “identifier”=>“”, “name”=>“k8sworker3”, “domain_id”=>“1”, “subnet_id”=>“1”, “ip”=>“10.10.40.173”, “ip6”=>“”, “managed”=>“1”, “primary”=>“1”, “provision”=>“1”, “virtual”=>“0”, “tag”=>“”, “attached_to”=>“”, “compute_attributes”=>{“type”=>“VirtualE1000”, “network”=>“network-422”}}}, “compute_attributes”=>{“cpus”=>“2”, “corespersocket”=>“1”, “memory_mb”=>“4096”, “firmware”=>“bios”, “cluster”=>“chainsaw.homelab.local”, “resource_pool”=>“Resources”, “path”=>“/Datacenters/HomelabSDDC/vm/Kubernetes-2”, “guest_id”=>“otherGuest”, “hardware_version”=>“Default”, “memoryHotAddEnabled”=>“0”, “cpuHotAddEnabled”=>“0”, “add_cdrom”=>“0”, “start”=>“1”, “annotation”=>“”, “scsi_controllers”=>“{"scsiControllers":[{"type":"VirtualLsiLogicController","key":1000}],"volumes":[{"thin":true,"name":"Hard disk","mode":"persistent","controllerKey":1000,"size":41943040,"sizeGb":40,"datastore":"QAPNAS-VMs"}]}”, “image_id”=>“500b1d91-6930-30f5-afc0-888d6a54be31”}, “architecture_id”=>“1”, “operatingsystem_id”=>“2”, “provision_method”=>“image”, “build”=>“1”, “medium_id”=>“7”, “ptable_id”=>“”, “pxe_loader”=>“”, “disk”=>“”, “root_pass”=>“[FILTERED]”, “is_owned_by”=>“4-Users”, “enabled”=>“1”, “comment”=>“”, “overwrite”=>“false”}}