willster07
Contributor
Contributor

Notes field in vSphere

If this isn't the correct board, please point me in the right direction.

Our VM Templates all have extensive details in the Notes section in vSphere and the problem is they aren't blanked out when deploying a VM from that template.

Is there a way to remove or blank out the Notes section when actually deploying the VM?  Perhaps running a command in the customization script?  Or even having a batch file saved on the windows template, that's called by the customization script?  I'm thinking there *might* be a vmtools command line that might accomplish it that way..?

Trying to only find a solution that does this on the deployment, or in that timeframe.  I don't want to just remove them all, or run a task every day that wipes out Notes from recent deployments, in case someone deployed one and updated the Notes section appropriately.

Thanks in advance.

0 Kudos
9 Replies
maksym007
Hot Shot
Hot Shot

Convert VM template to VM make needed notes there and convert it back to template. 

If I correctly understood what you mean.

0 Kudos
willster07
Contributor
Contributor

That would update the notes on the template, and iirc that's the only way.

But then when that template gets deployed, the newly created VM has those very same notes.

0 Kudos
marcdelavaud
Contributor
Contributor

in the same theme I would like to be able to change the notes in the customization process , no way ?

0 Kudos
tdoc210
Contributor
Contributor

I wonder if that would be doable in powercli

"Get-VM * |Set-VM -Description " " -Confirm:$false"

This should remove the notes from the new vm if you scripted out the template deploy.

0 Kudos
willster07
Contributor
Contributor

Get-VM *

Is that going to run through all VM's and blank out the field?

0 Kudos
maksym007
Hot Shot
Hot Shot

hmmm, is it in general possible? 

0 Kudos
tdoc210
Contributor
Contributor

yes sorry you should specify the vm's identity

0 Kudos
willster07
Contributor
Contributor

Hahaha yeah that's the issue I'm having.  I'd love to be able to add a runonce command into the customization script but how do I define "this vm that I'm deploying right now"?

Get-vm -name $env:Computername

?

I'll just have to make sure my template has powercli setup, which isnt' a problem..

0 Kudos
willster07
Contributor
Contributor

Actually that worked.  So my template will need the powercli modules and i haven't worked out if i can run the command in the runonce section of the customization script or, more likely call it from a cmd file that's already running as part of the customization script....one of the lines in the customization script is c:\Admin\Process.cmd and I could just call powershell from that...regardless...this worked and nearly instantly removed the Notes section of the VM:

Get-VM -name $env:Computername |Set-VM -Description " " -Confirm:$false

0 Kudos