VMware Cloud Community
sebin_j
Contributor
Contributor

How to clear lifecycle manager drafts

I'm using Set-Cluster to create the cluster image for remediation.

Get-Cluster -Name $CLUSTER |Set-Cluster -BaseImage $baseImage -VendorAddOn $vendor -Package $fwAddon -Confirm:$false

But sometimes, the vendor addon may not be compatible with the base image I have chosen, and hence I want to check with the next addon available. But on the second try, Im getting the error 

com.vmware.vapi.std.errors.already_exists {'messages': [com.vmware.vapi.std.localizable_message {'id': com.vmware.vcIntegrity.lifecycle.drafts.AlreadyExists, 'default_message': Record already exists., 'args': [], 'params': , 'localized': Record already exists.}]

How to clear the draft before I can retry?

0 Kudos
7 Replies
LucD
Leadership
Leadership

Try the Invoke-DeleteHostDraftSoftwareAddOn cmdlet, which is the generated cmdlet for the Delete Clusters Software Drafts Software  Add On REST API method.


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

0 Kudos
sebin_j
Contributor
Contributor

But as I created it through Set-Cluster I don't have a valid value for draft. Where we can find the associated drafts for the cluster?

0 Kudos
LucD
Leadership
Leadership

Try the Invoke-GetHostDraftSoftwareAddOn cmdlet.


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

0 Kudos
sebin_j
Contributor
Contributor

But for that as well draft is a required parameter

0 Kudos
sebin_j
Contributor
Contributor

I tried using Invoke-ListClusterSoftwareDrafts to get drafts, but I'm getting the error even though the cluster name is valid.

Invoke-vSphereApiClient : InvocationException: [NOT_FOUND]
Entity '<clustername>' does not exist or is not of type 'cluster'.
---> System.Net.WebException: The remote server returned an error: (404) Not Found.

0 Kudos
LucD
Leadership
Leadership

I also had the occasional issue with these generated cmdlets.
And the Help for these cmdlets is minimal I'm afraid.

But since they are part of the official PowerCLI distribution you should be able to open an SR.


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

0 Kudos
CLRYN
Contributor
Contributor

Did you ever find a solution for this? I have the exact same error 😞

0 Kudos