deployVirtualMachine Deploy a VM zoneid globalzoneid serviceofferingid globalserviceofferingid diskofferingid globaldiskofferingid templateid globaltemplateid account admin domainid 1 displayname TempSyncVM group group1 networkids globalnetworkid id vmid select id from volumes true Getting volume id for the VM created instance_id vmid id volumeid stopVirtualMachine Stop the Virtual Machine id vmid createTemplate Create template volumeid volumeid name privatetemplatename displaytext newtext osTypeId 12 account admin domainid 1 id privatetemplateid select download_state from template_host_ref true Getting volume path for the vm DATADISK volume template_id privatetemplateid download_state DOWNLOADED select install_path from template_host_ref true Getting install_path from the template template_id privatetemplateid install_path template_path listtemplate.sh List template directory after it was created h secondary_storage_ip s secondary_storage_dir p template_path removetemplate.sh Removing template file from secondary storage h secondary_storage_ip s secondary_storage_dir p template_path ms.sh Restarting management server h ms1 o restart ms.sh Restarting management server h ms2 o restart sleep.sh Sleep for 4 min s 240 select download_state from template_host_ref true Checking download state of the template in the DB after the template was deleted on secondary storage and management server process was restarted template_id privatetemplateid download_state DOWNLOAD_ERROR createTemplate Create template volumeid volumeid name privatetemplatename displaytext newtext osTypeId 12 account admin domainid 1 id privatetemplateid select download_state from template_host_ref true Getting volume path for the vm DATADISK volume template_id privatetemplateid download_state DOWNLOADED select install_path from template_host_ref true Getting install_path from the template template_id privatetemplateid install_path template_path listtemplate.sh List template directory after it was created h secondary_storage_ip s secondary_storage_dir p template_path corrupttemplate.sh Corrupting template file on secondary storage h secondary_storage_ip s secondary_storage_dir i privatetemplateid a 2 ms.sh Restarting management server h ms1 o restart ms.sh Restarting management server h ms2 o restart sleep.sh Sleep for 4 min s 240 select download_state from template_host_ref true Checking download state of the template in the DB after the template was deleted on secondary storage and management server process was restarted template_id privatetemplateid download_state DOWNLOAD_ERROR listtemplate.sh true Verify that template got removed from the secondary storage by template sync h secondary_storage_ip s secondary_storage_dir p template_path createTemplate Create template volumeid volumeid name privatetemplatename displaytext newtext osTypeId 12 account admin domainid 1 id privatetemplateid select download_state from template_host_ref true Getting volume path for the vm DATADISK volume template_id privatetemplateid download_state DOWNLOADED select install_path from template_host_ref true Getting install_path from the template template_id privatetemplateid install_path template_path listtemplate.sh List template directory after it was created h secondary_storage_ip s secondary_storage_dir p template_path createfaketemplate.sh Corrupting template file on secondary storage h secondary_storage_ip s secondary_storage_dir i privatetemplateid a 1 dir 300556 ms.sh Restarting management server h ms1 o restart ms.sh Restarting management server h ms2 o restart sleep.sh Sleep for 4 min s 240 listtemplate.sh true Verify that template got removed from the secondary storage by template sync h secondary_storage_ip s secondary_storage_dir p /template/tmpl/1/300556/template.properties createTemplate Create template volumeid volumeid name privatetemplatename displaytext newtext osTypeId 12 account admin domainid 1 id privatetemplateid select download_state from template_host_ref true Getting volume path for the vm DATADISK volume template_id privatetemplateid download_state DOWNLOADED select install_path from template_host_ref true Getting install_path from the template template_id privatetemplateid install_path template_path listtemplate.sh List template directory after it was created h secondary_storage_ip s secondary_storage_dir p template_path removetemplate.sh Removing template file from secondary storage h secondary_storage_ip s secondary_storage_dir p template_path ms.sh Stopping management server h ms1 o stop ms.sh Stopping management server h ms2 o stop ms.sh Starting management server h ms1 o start ms.sh Starting management server h ms2 o start sleep.sh Sleep for 4 min s 240 select download_state from template_host_ref true Checking download state of the template in the DB after the template was deleted on secondary storage and management server process was restarted template_id privatetemplateid download_state DOWNLOAD_ERROR createTemplate Create template volumeid volumeid name privatetemplatename displaytext newtext osTypeId 12 account admin domainid 1 id privatetemplateid select download_state from template_host_ref true Getting volume path for the vm DATADISK volume template_id privatetemplateid download_state DOWNLOADED select install_path from template_host_ref true Getting install_path from the template template_id privatetemplateid install_path template_path listtemplate.sh List template directory after it was created h secondary_storage_ip s secondary_storage_dir p template_path ms.sh Restarting management server h ms1 o restart ms.sh Restarting management server h ms2 o restart sleep.sh Sleep for 4 min s 240 select download_state from template_host_ref true Checking download state of the template in the DB after the template was deleted on secondary storage and management server process was restarted template_id privatetemplateid download_state DOWNLOADED deployVirtualMachine Deploy vm from private template after management server was rebooted zoneid globalzoneid serviceofferingid globalserviceofferingid diskofferingid globaldiskofferingid templateid privatetemplateid account admin domainid 1 displayname PrivateTempSyncVM group group2 networkids globalnetworkid id vmid registerTemplate Register template name registername displaytext registerdisplay url globaltemplateurl ostypeid 12 format vhd zoneid globalzoneid account admin domainid 1 id privatetemplateid sleep.sh Sleep for 5 min s 300 select download_state from template_host_ref true Getting volume path for the vm DATADISK volume template_id privatetemplateid download_state DOWNLOADED select install_path from template_host_ref true Getting install_path from the template template_id privatetemplateid install_path template_path listtemplate.sh List template directory after it was created h secondary_storage_ip s secondary_storage_dir p template_path removetemplate.sh Removing template file from secondary storage h secondary_storage_ip s secondary_storage_dir p template_path ms.sh Stopping management server h ms1 o stop ms.sh Stopping management server h ms2 o stop ms.sh Starting management server h ms1 o start ms.sh Starting management server h ms2 o start sleep.sh Sleep for 15 seconds s 15 select download_state from template_host_ref true Checking download state of the template in the DB after the template was deleted on secondary storage and management server process was restarted template_id privatetemplateid download_state DOWNLOAD_IN_PROGRESS destroyVirtualMachine Destroy virtual machine as a part of cleanup id vmid