VMware Cloud Community
Sanjuro
Contributor
Contributor

PowerCLI to write zeros to all drives for multiple VM's


All,

For security we are required to write zero our VM HD's when decommissioning them. I would like to use a PowerCLI script to do this. The only way I know to do this is by logging into the host and running vmkfstools -w [path to vmdk file]. Unfortunately, I have to wait until one drive is done before I can start on another. If there is a simpler way within the CLI or if anyone has a script that would be helpful.

Thanks!

Reply
0 Kudos
3 Replies
LucD
Leadership
Leadership

In vSphere there are disk formats that do that for you, i.e. zeroed thick.

You could just the New-Harddisk cmdlet and on the StorageFormat parameter specify EagerZeroedThick.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
Sanjuro
Contributor
Contributor

Will that zero out everything on the .vmdk or just the unused space on the disk? 

Reply
0 Kudos
LucD
Leadership
Leadership

Reply
0 Kudos