VMware Cloud Community
WenshengLiu
Contributor
Contributor

can not delete Custom Resources in Advanced Services

Hi, All,

I encounter a problem when I try to delect a custom resources in advanced services.

Initially,

1。 I created Custom Resources named: Create DC, type:VC:datacenter

2。 Created a service blueprints named create datacenter with workflow (external vCO 5.5) - create a datacenter,provisioned resource with the above custom resources and published it.

3。created a service at Administration named test, add published service blueprints as catalog items.

4, created entitlements, add service:test, catalog items:create datacenter

5, I used Catalog request to create a datacenter OK

Then, I try to clear all of the service and its custom resources

1. I removed provisioned resource in service blueprints for create datacenter

2. delete any relational items in Administrator: services, entitlements...

3 try to delete custom resources : Create DC ,

but recevice an error :Service not found. If the problem persists, contact your system administrator.

Is there anyone can help me? tks

25 Replies
kdelgadovmw
VMware Employee
VMware Employee

Hi there

What did you do with the provisioned datacenter after you requested it?  and also the ASD blueprint?

Thanks

Kim

@KCDAutomate
Reply
0 Kudos
WenshengLiu
Contributor
Contributor


Hi, Kim,

After I provisioned a datacenter, I tried to delete the custom resource(name-Create DC, type-VC:Datacenter) which is associated with ASD blueprint create a datacenter, but I failed with the error ---A service blueprint or a resource action is associated with this custom resource. You cannot delete a custom resource associated with a service blueprint or a resource action.

So I  unselected the Create DC from Provisioned Resource of service blueprint-create a datacenter and  leave the drop-text no provisioning, then tried to delete custom resource again, but still met an error:Service not found. If the problem persists, contact your system administrator.

Reply
0 Kudos
qc4vmware
Virtuoso
Virtuoso

I think I have run into something similar here.  I created a custom resource for VC:VirtualMachine and a workflow for deploying a vm.  This all worked just fine.  Now I have a tab for "vCenter Server" in my items list which shows the vm that I deployed.  Now i want to remove that item but I don't see how I do this.  Do I add a custom action for deletion?  Can I just delete the vm through vCenter and expect that vCAC will see it no longer exists and will remove it from my items list?

Reply
0 Kudos
nikolovk
VMware Employee
VMware Employee

Hi

The problems which You are observing are different and they are not connected.

Reply
0 Kudos
nikolovk
VMware Employee
VMware Employee

Reply
0 Kudos
qc4vmware
Virtuoso
Virtuoso

OK... so what will happen if I go into vCenter and delete the vm manually?  Will vCAC detect that item was removed?  It sounds like it won't but I figured I would check.  It is annoying because now I have this "vCenter Server" category on the item screen which is highlighted when I login as any user and it has nothing listed.  I have to click on the "Machines" category to see my IaaS systems that were deployed.  It threw me off at first.  Is there any way to get rid of that item category or is that all part of this missing feature which is coming in 6.1?

Reply
0 Kudos
rszymczak
Hot Shot
Hot Shot

Hi nikolovk,

so can you confirm that for the current version of vcac (6.0.1) there is no "recommended" way to delete a custom resource object from the "my items" list (or - in other words - to mark a custom resource vcac entity as deleted)?

If so, the only possible way atm would probably be editing the vcac database directy, right?

Reply
0 Kudos
nikolovk
VMware Employee
VMware Employee

Hi

Reply
0 Kudos
rszymczak
Hot Shot
Hot Shot

Interesting. Do you maybe have some docs that i could look up that talk about how vco / vcac caching is related to eachother? I'm not quite sure what the vCO cache is used for or how it affects the vCAC entities. I'm using a custom plugin with custom types created - so i could disable caching if that would help. However, I'm not sure what it will cause.

Reply
0 Kudos
nikolovk
VMware Employee
VMware Employee

Unfortunately I do not have a doc for that. The issue appears when right after a resource action execution, the vCAC asks vCO if a resource still exists. When plugin caching is enabled, sometimes the response is positive (not updated cache) even that the resource does not exist.

Reply
0 Kudos
rszymczak
Hot Shot
Hot Shot

I see. So vCAC IS checking if a item exists after every action run? This means that, if i re-run the delete operation from vcac for the (within the vco inventory already deleted) item it should handle it and remove it from the item list? or atleast after restarting vco (== flushing the cache) and then vcac (== reload all items from vco) the items should be gone?

In the meantime I just did a search for "plugin caching" and found nothing about it 😕  Can you point me to the spring class that's handling the object caching?

Reply
0 Kudos
nikolovk
VMware Employee
VMware Employee

Probably you can try to rerun the resource action But have in mind that it should succeed so to trigger that existence check.

Reply
0 Kudos
rszymczak
Hot Shot
Hot Shot

I was able to sucessfully test the behaviour. When running a second workflow (which basicly does nothing and thus will always run successful)  on the custom resource after the delete workflow, then the entity will be removed from the item list.

So, it really is related to the caching. However: within the plugin I never implemented a custom caching as mentioned in the vCO Plugin Dev Guide. I guess that vCO is using some "default" caching. Can you provide any information about how to disable that using the Spring vCO Plugin configuration?

Reply
0 Kudos
nikolovk
VMware Employee
VMware Employee

I will check that with the vCO team, because they have the required knowledge to resolve that. Will reply when get an answer.

Reply
0 Kudos
rszymczak
Hot Shot
Hot Shot

Ok, thanks - I will watch this thread for any answers since disableing the cache would probaby be the best way to do it (also I'm quite interested what classes do handle that).

However, I guess for the most folks this wont work since they don't have a custom plugin nor can they control the caching and vcac 6.1 may still take some time to arrive. So here a quick and dirty solution that works for me:

You may add the vCAC PostGre SQL Database to the vCO SQL Plugin and then you may use the "__asd_targetResourceInternalId" send with every request from vCAC to vCO to mark the vCAC entity as deleted after you deleted the real resource from vCOs inventory.

Such a query may look like this: "UPDATE cat_resource SET status='DELETED' WHERE id='" + __asd_targetResourceInternalId + "';";


Don't try to really delete the DB entry since it would probaby mess up your database. Hope that helps anyone who comes around.

rszymczak
Hot Shot
Hot Shot

Any replay from the vCO team yet?

Reply
0 Kudos
rszymczak
Hot Shot
Hot Shot

Also it would be quite interesting how vCAC is able to find the accosiated vCO resource. I searched the vCAC and vCO database dump for the unique ID used by vCAC (later on passed as __asd_targetResourceInternalId) and the unique object id used by vCO for it's inventory objects. There seems to be no way to find the vCO resource only given the vCAC resource and vise versa - so I'm wondering what's the trick here. How does vCAC uniquely reference a vCO object?

Reply
0 Kudos
JCOEN
Enthusiast
Enthusiast

I'm running vCAC 6.1 and running into this exact problem. I created a custom resource and assigned it to  a service blueprint for post-provisioning. I now have items showing up in my items list added from this service blueprint. How do I delete these items from the list? I can't find a workflow to do it or figure out which table in the database has these entries so I can manually purge.

Reply
0 Kudos
jlholbrook
Enthusiast
Enthusiast

This worked for me using pgAdmin to browse and identify the resources by hand, and then target them for deletion by id using the update method.

Thanks for taking the time to post this!

Regards,

Jesse

Reply
0 Kudos