VMware Horizon Community
Lyghtnin
Enthusiast
Enthusiast
Jump to solution

Remove Imported Appstacks

I have 2 AppVolume environments - 1 Prod v2.10 and 1 POC v2.12

In the POC, I imported a few appstacks from Prod which basically imports the stack names leaving the vmdks in their original storage folder location because of this, I cannot delete the appstacks from the POC as it would delete them from the prod storage folder location - anyone know of a way to 'un-import' or 'remove from inventory' without deleting the actual vmdks?

1 Solution

Accepted Solutions
Ray_handels
Virtuoso
Virtuoso
Jump to solution

I do understand where you are coming from and I do understand why you called it a POC.

Just so you know, it eventually boils down to what you would like to do and achieve, not what I think you should be doing Smiley Happy.

That being said. My previous point still stands. If you are to build a new production environment just make sure to create a new folder on your datastore (or use a different datastore) and copy the appstacks from the old production to the new production store, then import them. This way you won't get any inconsitencies in your database. Now, if you were to remove it from 1 database the older would still hold the information. And (but that's just my cents) I don't see any good reason to not have the information in the database but do have the appstack stored on your datastore, this would only be confusing as you would never be able to use the import button anymore without going over the exact same action again.

View solution in original post

Reply
0 Kudos
6 Replies
Lakshman
Champion
Champion
Jump to solution

Do not use same datastore for POC and Production. I'm not aware of any way to unimport the AppStack as it has to deal with the database tables.

Another option is to reinstall App Volumes Manager in POC and select 'overwrite' existing database checkbox during installation (hope the databases are different). Make sure to use this option only if POC environment is no more required as it will reset all the settings in App Volumes Manager.

Reply
0 Kudos
Lyghtnin
Enthusiast
Enthusiast
Jump to solution

The POC will become the new Prod and the Appstacks that were imported have duplicate apps in them so I will not be using the Prod Appstacks so I need to 'un-import' them - hence the question. I don't need other options, I need them un-imported, if removing the entries from the database is the only way to do this, then hopefully someone can provide those instructions?

Reply
0 Kudos
techguy129
Expert
Expert
Jump to solution

You can run this query. This isn't recommended or supported. Be sure to have a fresh backup of the database before running it in case something goes wrong. Make sure the appstacks aren't mounted or assigned anywhere. Test the environment thoroughly after you run it.

You'll need to change the appvoldb and 'notepad ++' to fit your POC.

USE appvoldb;

DECLARE @appstackname char(20);

SET @appstackname = 'Notepad ++';

delete from snapvol_apps where snapvol_id=(select id from snapvols where name=@appstackname)

delete from snapvol_files where snapvol_id=(select id from snapvols where name=@appstackname)

delete from snapvol_members where snapvol_id=(select id from snapvols where name=@appstackname)

delete from snapvols where name=@appstackname

Ray_handels
Virtuoso
Virtuoso
Jump to solution

I would not suggest removing stuff from the database because there are a lot of connection between different tables. The query does seem quite legit though Techguy.

Also, if you were to do another import it would be back into the database again.

Even if you are to use a production together with a POC I agree with Lakshman, never use 1 location with 2 different databases.

If you want to migrate from 1 enviornment to another it's as simple as copying the files from datastore A to datastore B and import the appstacks.

You would only need to reassign appstacks.

Reply
0 Kudos
Lyghtnin
Enthusiast
Enthusiast
Jump to solution

Ray - It's not a POC - I called it that because I didn't want to label it old prod new prod to avoid confusion. I created a new database and new environment because the first one is shit - they created appstacks with 1 app in each stack like notepad++ by itself and it's built on 2008 servers and we are doing 2012 so it was completely appropriate to build it this way. There was never any intention of migrating anything and clearly already imported appstacks I do not want which is why I need to remove them.

I thought that when I imported them it would copy the stacks to the new datastore and I could delete them after, which is clearly not the case. There needs to be a remove from inventory or something added to App Volumes not just an import and delete only.

Reply
0 Kudos
Ray_handels
Virtuoso
Virtuoso
Jump to solution

I do understand where you are coming from and I do understand why you called it a POC.

Just so you know, it eventually boils down to what you would like to do and achieve, not what I think you should be doing Smiley Happy.

That being said. My previous point still stands. If you are to build a new production environment just make sure to create a new folder on your datastore (or use a different datastore) and copy the appstacks from the old production to the new production store, then import them. This way you won't get any inconsitencies in your database. Now, if you were to remove it from 1 database the older would still hold the information. And (but that's just my cents) I don't see any good reason to not have the information in the database but do have the appstack stored on your datastore, this would only be confusing as you would never be able to use the import button anymore without going over the exact same action again.

Reply
0 Kudos