createAccount [Create the Account and a User for the account] account accountname accounttype 1 domainid 1 email admin@gmail.com firstname admin lastname adminlastname username usernameparam password password id accountid createNetwork [Creating default network] zoneid globalzoneid networkOfferingId globalnetworkofferingid account accountname domainid 1 name defaultregressionnetwork displaytext defaultregressionnetwork id networkid deployVirtualMachine [Deploy a Virtual Machine under the Account] zoneid globalzoneid serviceofferingid globalserviceofferingid templateid globaltemplateid account accountname domainid 1 networkids networkid id vmid name vmname ipaddress vmipaddress listVolumes [List the ROOT Volume of the VM] virtualmachineid vmid type ROOT id rootvolumeid stopVirtualMachine [Stop virtual machine] id vmid createTemplate [Create template from root volume] volumeid rootvolumeid name displaytext newtext osTypeId 12 id privatetemplateid deployVirtualMachine [Deploying virtual machine from the Private Template] zoneid globalzoneid serviceofferingid globalserviceofferingid diskofferingid globaldiskofferingid templateid privatetemplateid account accountname domainid 1 displayname VMcreatedfrmTemplate group group1 networkids networkid id vmid1 hostid vm_hostid listHosts List host where vm is running id vm_hostid ipaddress vmhost_ipaddress select install_path from template_spool_ref true Getting private template vdi from the db template_id privatetemplateid install_path template_uuid listvdi.sh List VDI for template on the xen host before vm is destroyed h vmhost_ipaddress u template_uuid destroyVirtualMachine Destroy virtual machine created from the private template id vmid1 listConfigurations Getting expunge interval value name expunge.interval value expunge.interval updateConfiguration Updating storage.cleanup.interval name storage.cleanup.interval value 60 listConfigurations Getting expunge interval value name storage.cleanup.interval value storage.cleanup.interval ms.sh Restarting management server h ms1 o restart sleep.sh Sleep for expunge interval s expunge.interval sleep.sh Sleep for another expunge interval s expunge.interval sleep.sh Sleep for Storage CleanUp interval s storage.cleanup.interval sleep.sh Sleep for another Storage CleanUp interval s storage.cleanup.interval listvdi.sh true List VDI for template on the xen host after vm using template is destroyed h vmhost_ipaddress u template_uuid deployVirtualMachine Deploying virtual machine from the private template zoneid globalzoneid serviceofferingid globalserviceofferingid diskofferingid globaldiskofferingid templateid privatetemplateid account accountname domainid 1 displayname VMcreatedfrmTemplate group group1 networkids networkid id vmid1 hostid vm_hostid listHosts List host where vm is running id vm_hostid ipaddress vmhost_ipaddress select install_path from template_spool_ref true Getting private template vdi from the db template_id privatetemplateid install_path template_uuid listvdi.sh List VDI for template on the xen host before vm is destroyed h vmhost_ipaddress u template_uuid destroyVirtualMachine Destroy virtual machine created from the private template id vmid1 listConfigurations Getting expunge interval value name expunge.interval value expunge.interval sleep.sh Sleep for expunge interval s expunge.interval sleep.sh Sleep for another expunge interval s expunge.interval sleep.sh Sleep for Storage CleanUp interval s storage.cleanup.interval sleep.sh Sleep for another Storage CleanUp interval s storage.cleanup.interval listvdi.sh true List VDI for template on the xen host after vm using template is destroyed h vmhost_ipaddress u template_uuid startVirtualMachine [Start virtual machine] id vmid state Running rebootVirtualMachine [Reboot Virtual Machine] id vmid destroyVirtualMachine [Destroy virtual machine] id vmid listVirtualMachines [Verify that vm was destroyed] id vmid state Destroyed deleteTemplate Delete private template id privatetemplateid deleteAccount [Delete account] id accountid