Error: Cannot create a quiesced snapshot

Posted by : on

Category : powershell   script   troubleshooting


I came across an issue this weekend that I wanted to share. I’ve written a script that automates the process my company uses to conduct a refresh of a production machine. Recently, we’ve upgraded our vCenter from 4.0 to 4.1. In addition, PowerCLI was upgraded to 4.1.1. Of course, some things are off on my script now (I’m currently in the process of fixing all the new bugs the upgrade introduced).

Until I get all the kinks worked for the script to run properly again, I decided to run the script locally from my machine. The problem with this is that my workstation is not on the domain. This causes a few portions of the script that needs domain access to fail. One of these sections involves moving the source VM to a different OU so that the security banner is removed at login. I expected this portion to fail, however, I did not expect it to generate an error within the VC and domino out of control.

The error that I got was “Error: Cannot create a quiesced snapshot.” I quickly stopped the script and referenced Professor Google on the issue, and found the following link on the matter.

http://www.cenobite.eu/index.php?option=com_content&view=article&id=32:cannot-create-a-quiesced-snapshot&catid=8:esx&Itemid=33

I quickly read through the post and verified my VM, the settings, and the script. Then I noticed something. This is the section of my script that caused the error.

# DISABLE SECURITY BANNER
$bDisableSecurityBanner = $True
# CALLS BANNER FUNCTION TO MOVE VM TO DIFFERENT OU
banner

# CALLS FUNCTION TO POWER OFF VM
PowerOff-VM $sourcevm
Write-host "Pausing for system shutdown"
# PAUSES TO GIVE THE VC ENOUGH TIME TO REPORT THE VM OFFLINE
Sleep 15
Write-Host "VM Shutdown Complete" 

# CALLS FUNCTION TO POWER ON VM
PowerOn-VM $sourcevm
Write-host "Pausing for system startup"
# PAUSES TO GIVE THE VM ENOUGH TIME TO START AND LOAD VMTOOLS
Sleep 30
Write-Host $sourcevm "Powered On"

The problem that occurred here was that the VM was power-cycled, but the desktop stilled showed that it was “Applying New Settings”. So enough time had not transpired to provide the VM, the opportunity to complete the boot cycle. Right after this the script removes the destination VM, and then starts the clone process. Since the desktop had not completed the boot cycle, I got the error. When the clone process attempted to take the snapshot so that it could start cloning, the VM was not in a ready state.

To resolve this, I wound up having to revert back to the manual process. During that process, if I waited for the VM to complete its’ boot cycle, then all was well. For me to correct my script, I will be implementing the following logic check to verify the status and see if it the powercycle was successful.

do 
	{
	sleep 10
	$vmview1 = Get-VM $sourcevm | get-view
	$vmview2 = Get-VM $sourcevm
	$status1 = $vmview1.Guest.ToolsStatus
	$status2 = $vmview2.PowerState
	}until (($status2 -match "PoweredOn") -and ($status1 -match "Ok"))

This should loop until the VM is registered as “PoweredOn” and the VMTools are registered as “OK”. This will require VMTools being current, else the loop will never end because VMTools will not read “Ok”.


About Sam Aaron
Sam Aaron

Father, Husband, Geek. Workaholic.

Email : mail@micronauts.us

Website : http://micronauts.us

About Sam Aaron

Father. Husband. Geek. Workaholic. US Marine Corps Veteran.

Sam Aaron is a Senior Consultant in the Professional Services Organization for Entelligence, bringing over a decade of expertise in enterprise cloud automation and infrastructure. Sam has spent almost eleven years at VMware leading cloud automation initiatives using VCF Automation (formerly Aria Automation & vRA) and designing scalable, multi-tenant environments with VMware Cloud Director (vCD).

Sam holds multiple certifications including VCF-Architect 2024, VCIX-CMA, and dual VCPs (DCV & CMA), and is a recognized contributor to VMware’s certification exams. As a VMware Hands-On Lab (HOL) Captain and content author from 2015-2025, Sam played a key role in educating and mentoring the global VMware community. He helped to create and develop the automation challenge and troubleshooting labs for VMworld and global virtual forums.

When Sam is not working, he has several hobbies, among these are 3D printing Star Wars robots and turning them into animatronics.

Launched in April 2010, micronauts is Sam's online presence. Here, he has been blogging and sharing knowledge with the virtualization community. This blog acts as a central repository to retain the resolutions and other trivial knowledge that Sam has discovered.

** No information provided here was reviewed or endorsed by VMware by Broadcom, Microsoft, or anyone else for that matter. All information here are opinions based on Sam's personal experience. Use this knowledge at your own risk. **

Star
Useful Links