cancel
Showing results for 
Search instead for 
Did you mean: 

Delete _VCB-BACKUP_ from Virtual Machines

HEMANPR
Level 6
Hello People
I have some Virtuals Machines in my Vritual Machines Backup Policy with errors 156. Commonly this error happen when the Virtual Machine have a VCB Snapshot created on the Snapshot Manager.

I found a Power Shell command for delete the _VCB-BACKUP_ create automactly by FrameWork on the Virtuals Machines. Here the post:

-------------------------------------------------------------------------------------------------------------------------------------------

I managed to get the script
Solution
I managed to get the script for you.  Actually i was wrong its not a bat script, its a POWER SHELL script.
so you have to download power shell, its a freeware.  Install it and schedule it in windows scheduler
The content of the script goes like this. The file extension of the script file is .PS
add-pssnapin VMware.VimAutomation.Core;
Connect-VIServer –Server <esx host name> –Protocol https –User <domain/name> –Password <password>
$snap=get-snapshot -vm * -Name "_VCB-BACKUP_";
Remove-Snapshot -Snapshot $snap -confirm:$false;
We are running this script everyday morning at 8 AM when there are no VCB backups running.
Hope this helps
------------------------------------------------------------------------------------------------------------------------------------------------------

 
My Questions are:
This scrip is secure for run everyday using windows schedule?
The Script Just delete the VCB Backup Snapshot, not the entire Virtual Machine?
Affect the Virtual Machines Files?
Write over the Virtual Machine Storage Disk?
We never use PowerShell Before, that's the reason why we are asking for help. Any suggestion are welcome.
Thanks for your help.
 
7 REPLIES 7

HEMANPR
Level 6
That Power Shell Command script was posted by Sriram
 

HEMANPR
Level 6
Any help on this>?

Nick_F1
Level 3
Not used that script (although it's on my list to install) but from the code you've posted then all it's doing is searching a specified ESX host for any VCB snapshots and then deletes them. It won't affect the VM itself or delete non-VCB snapshots.
If you wanted to be thorough and test it then just vmotion all the VMs of one of your ESX hosts and run the script against a test VM on that host and see what happens.

HEMANPR
Level 6
Any Example of the code what we need to use?
Any .bat file create to remove those Snapshots? If any pls post.
Thanks

rj_nbu
Level 6
Employee Accredited Certified
Hi, In my opinion, finding a root cause for VCB snapshots being orphaned is more important. The fact is that the snapshot of a vm taken by vcbmounter must be deleted after a backup job fails or succeeds, which is not happening in your case

I assume here that you are using virtual center. you can check the following link to increase the snapshot timeout in vcenter, which should resolve your problem of left over snapshots

h
ttp://kb.vmware.com/kb/1004932

Hope this helps

Peter_Brown
Level 2
We've got a 2-step approach to managing this:

1.  A POSH script that is called from the BPSTART_NOTIFY script that removes the snapshot of the VM prior to its VCB backup running

2.  A POSH script that will gather inventory of the ESX hosts through our VC in the morning after backups have run and email it to show what systems still have snapshots (and LOTS of other info as well).

This solution seems to work quite well in our environment.

I can't take all the credit for the code used as I got the ideas and some code from the VMWare community.  Why reinvent the wheel when you can stand on other's shoulders! 

I can share the script(s), but will have to "sanitize" it prior to upload.  

Karthikeyan_Sun
Level 6
We have also faced the same issues some time before and i was also searching for some scripts to delete them automaticaly and we were using vcbcleanup.bat to delete the older VCB snapshots.. But Now a days we are facing that issue.. '

What is your NetBackup Verison and VCB Version. We are at VCB 1.5.0 and NBU 6.5.5.