createAccount [Create the Account and a User for the account] account accountname accounttype 1 domainid 1 email admin@gmail.com firstname volumesexpungeadmin lastname volumesexpungeadminlastname username usernameparam password password id accountid listUsers 5 [List the Created User in (3)] account accountname id userid registerUserKeys Registering the user id userid apikey apikey secretkey secretkey createNetwork [Creating default network] zoneid globalzoneid networkOfferingId globalnetworkofferingid account accountname domainid 1 name defaultregressionnetwork displaytext defaultregressionnetwork id networkid deployVirtualMachine true Deploy vm from regular centos template zoneid globalzoneid serviceofferingid globalserviceofferingid diskofferingid globaldiskofferingid templateid globaltemplateid account accountname domainid 1 displayname VolumeExpungeTest-VM group group1 networkids networkid id vmid name vmname listVirtualMachines List virtual machines id vmid hostid vm_hostid listHosts List host where vm is running id vm_hostid ipaddress vmhost_ipaddress listRouters List Routers zoneid globalzoneid account accountname domainid 1 id router_id hostid router_hostid name routername listHosts List host where domR is running id router_hostid ipaddress routerhost_ipaddress listVolumes List data disk vm volume virtualmachineid vmid type DATADISK id vm_datavolumeid name vm_datavolumename select path from volumes true Getting volume path for the vm DATADISK volume id vm_datavolumeid path vm_datavolumepath listVolumes List root disk vm volume virtualmachineid vmid type ROOT id vm_rootvolumeid name vm_rootvolumename select path from volumes true Getting volume path for the vm root volume id vm_rootvolumeid path vm_rootvolumepath select path from volumes true Getting volume path for the domR instance_id router_id path router_rootvolumepath listvdi.sh List VDI for vm DATADISK volume before vm is destroyed h vmhost_ipaddress u vm_datavolumepath listvdi.sh List VDI for vm ROOT volume before vm is destroyed h vmhost_ipaddress u vm_rootvolumepath listvdi.sh List VDI for router ROOT volume before domR is destroyed h routerhost_ipaddress u router_rootvolumepath destroyVirtualMachine Destroy virtual machine id vmid 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 listvdi.sh true List VDI for vm DATADISK volume before vm is destroyed h vmhost_ipaddress u vm_datavolumepath listvdi.sh true List VDI for vm ROOT volume before vm is destroyed h vmhost_ipaddress u vm_rootvolumepath createVolume true Creating a volume name zoneid globalzoneid diskofferingid globaldiskofferingid id volumeid attachVolume true Attach the Volume to an Existing VM id volumeid virtualmachineid vmid detachVolume true Detach the Volume from the VM id volumeid createSnapshot true Create snapshot from detached volume volumeid volumeid id snapshotid path snapshotpath select path from volumes true Getting volume path for the detached volume id volumeid path detached_volumepath listvdi.sh List VDI for detached volume before the volume is deleted h vmhost_ipaddress u detached_volumepath deleteVolume Delete detached volume true id volumeid sleep.sh Sleep for expunge interval s expunge.interval sleep.sh Sleep for another expunge interval s expunge.interval listvdi.sh true List VDI for detached volume after the volume is deleted h vmhost_ipaddress u detached_volumepath listvdi.sh List VDI for snapshot after it's created h vmhost_ipaddress u snapshotpath stopRouter Stop the domR id router_id deleteUser Deleting the user id userid listvdi.sh true List VDI for domR after it's destroyed as a part of account cleanup h routerhost_ipaddress u router_rootvolumepath listvdi.sh true List VDI for snapshot after corresponding account is deleted h vmhost_ipaddress u snapshotpath updateConfiguration Updating storage.cleanup.interval name storage.cleanup.interval value 60 ms.sh Restarting management server h ms1 o restart ms.sh Restarting management server h ms2 o restart deployVirtualMachine true Deploying virtual machine from centos template zoneid globalzoneid serviceofferingid globalserviceofferingid diskofferingid globaldiskofferingid templateid globaltemplateid account accountname domainid 1 displayname ExpungeTestVM-1 group group1 networkids networkid id vmid listVolumes 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 admin 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 sleep.sh Sleep for storage cleanup interval s 240 listvdi.sh true List VDI for template on the xen host after vm using template is destroyed h vmhost_ipaddress u template_uuid destroyVirtualMachine Destroy virtual machine as a part of cleanup id vmid deleteTemplate Delete private template id privatetemplateid updateConfiguration Updating storage.cleanup.interval name storage.cleanup.interval value 60000 ms.sh Restarting management server h ms1 o restart ms.sh Restarting management server h ms2 o restart