VMware Cloud Community
xugangsh
Contributor
Contributor

How to remove template by command line

Hi

Could anyone tell me how to remove template by command line?

Thanks!

Reply
0 Kudos
6 Replies
xugangsh
Contributor
Contributor

Anyone knows? It is very urgent.

Read some documents, only find vmware-cmd can remove snapshots.

Is template the same as snapshot? I guess no.

Reply
0 Kudos
dnsfnk
Contributor
Contributor

I am interesting in this question too.

Has someone found solution?

Reply
0 Kudos
crawfordm
Expert
Expert

Using powercli

Remove-Template -Template {template name}

------------------------------------------------------------------ If you found this answer useful please consider the use of the Helpful or Correct buttons to award points. Thanks, Marc Crawford CCNA, MCSE, MCTS, A+, Net+, Sec +, VCA-WM, VCA-DCV, VCA-Cloud, VCA-NV, VCP-NV, VCP-DCV, VCP, VCAP5-DCA http://gplus.to/marccrawford http://blog.marccrawford.com @uber_tech_geek
Reply
0 Kudos
dnsfnk
Contributor
Contributor

Hello Crawfordm,

Thank you for your quick reply! Yes, I saw that documentation, but as I know PowerCLI work only from Windows.

Can I perform this from Linux side?

I have checked all parameters for following commands but haven't found correct one:

# vim-cmd

# esxcli

Reply
0 Kudos
dnsfnk
Contributor
Contributor

I can directly remove it from storage side:

# rm -Rf /vmfs/volumes/SATA1/a2011a28dade3a9597b42bc93379758b/

But in this way 'a2011a28dade3a9597b42bc93379758b' template still will be in Inventory.

Reply
0 Kudos
Rubeck
Virtuoso
Virtuoso

But in this way 'a2011a28dade3a9597b42bc93379758b' template still will be in Inventory.

This is because the ESXi host itself doesn't know anything about templates... only vCenter does.  This info lives in the vCenter DB, so removing it from inventory can only be done using vCenter.

When you mark a VM as a Template the VM is actually unregistered from the ESXi host...   Only vCenter then knows it exists.

/Rubeck

Reply
0 Kudos