VMware Horizon Community
ntripp13
Enthusiast
Enthusiast
Jump to solution

App Volume Rest API

I'm automating some replication process (lun to lun) to keep our DR machines updated with writable volumes and App Volumes from production. Is there a way to update the datastore via the API?

1 Solution

Accepted Solutions
Ray_handels
Virtuoso
Virtuoso
Jump to solution

As said, we use a powershell script that checks if a disk is changed within a week (check it's timestamp) and then copy it from storage 1 to storage 2.

because we only copy we don;t do anyhting with the current writables, they are on the storage and Appvolumes can contact them.

If we do need to restore a writable it's as easy as just copying them from the backup location to the production location and overwrite the files. No need to do an import or anything like that. Because Appvolumes expects a disk to be there it's that simple. Off course the user needs to be logged out otherwise the disk is delete protected Smiley Happy. Normally a restore takes up to 10 minutes but this is mostly due to the fact that it takes a few minutes for all disks to show up in the datastore browser in VSphere Smiley Happy.

View solution in original post

Reply
0 Kudos
11 Replies
Lakshman
Champion
Champion
Jump to solution

As far as i know, there is no API to update the datastore. Also, please note that App Volume APIs are not officially supported by VMware.

For replicating AppStacks from Production to DR, you may use 'Storage Groups' in App Volumes Manager that replicates the AppStacks across datastores.

Reply
0 Kudos
Ray_handels
Virtuoso
Virtuoso
Jump to solution

This is a problem that has been around as long as Appvolumes has been around. This only works for readonly appstacks not for changable writables that can only be placed at 1 point in any given time.

We eventually came up with a solution to copy the writables from 1 NFS storage to another NFS stroage and vice versa with a "man in the middle" Server 2012 machine with an NFS client.

Not the best of all options but at least we have a backup of writables.

That being said. If anyone has a better solution please let me know. More than willing to listen to all options on the table Smiley Happy.

We were quite hopefull with the release of ESXi 6.5, I believe that it has a copy-disk powercli command. Only thing is we don't have 6.5 running just yet (testing with it) and I'm not the best of all PowerCLI programmer. Smiley Happy

Reply
0 Kudos
ntripp13
Enthusiast
Enthusiast
Jump to solution

What are you doing to copy the files? Once they are copied how do you make sure they are imported? Do you have to purge the previous copies from the destination on refreshes?

Reply
0 Kudos
Ray_handels
Virtuoso
Virtuoso
Jump to solution

As said, we use a powershell script that checks if a disk is changed within a week (check it's timestamp) and then copy it from storage 1 to storage 2.

because we only copy we don;t do anyhting with the current writables, they are on the storage and Appvolumes can contact them.

If we do need to restore a writable it's as easy as just copying them from the backup location to the production location and overwrite the files. No need to do an import or anything like that. Because Appvolumes expects a disk to be there it's that simple. Off course the user needs to be logged out otherwise the disk is delete protected Smiley Happy. Normally a restore takes up to 10 minutes but this is mostly due to the fact that it takes a few minutes for all disks to show up in the datastore browser in VSphere Smiley Happy.

Reply
0 Kudos
ntripp13
Enthusiast
Enthusiast
Jump to solution

I see so just a powershell copy and overwrite the destination.

Reply
0 Kudos
Ray_handels
Virtuoso
Virtuoso
Jump to solution

If you do a restore yes, just copy and overwrite.

Reply
0 Kudos
ntripp13
Enthusiast
Enthusiast
Jump to solution

Works pretty well. Thanks!

Reply
0 Kudos
Ray_handels
Virtuoso
Virtuoso
Jump to solution

Just out of curiosity. How do you do the backup now? Do you use a script to copy the writables? Or do you do it manually? We have over 2000 writables so manual is not really an option here Smiley Happy.

Also, how long does it take for 1 disk to be copied from 1 place to the other? We do see that during the copy it seems as if it does copy the full 20GB of the writable (yes, we extended the file a bit, 10 is very small for UIA + Profile) although the file is still thin provisoned when it arrives at the other end.

Reply
0 Kudos
Sravan_k
Expert
Expert
Jump to solution

Hi,

You can use SCP command to transfer all writable volumes from one host at source to other host at destination host

note: make sure the host is attaching/having the shared "appvol datastore", please let me know if you need any help on "SCP command"

Thank you.

Ray_handels
Virtuoso
Virtuoso
Jump to solution

Hey VKMR. My guess is that SCP is a linux based command? I'm not that big of a programmer Smiley Happy.

And if that would be possible, yes please Smiley Happy

We do check now if a writable has been changed or not and we only backup the writable if it has been changed indeed. Otherwise we just leave it there and don;t backup the file.

Reply
0 Kudos
Sravan_k
Expert
Expert
Jump to solution

Ray,

I agree with you it is Linux command, here it is

so your writable volumes has a storage which is attached to ESX host as datastore right?

if yes, we can use SCP to move all writable volumes from source host to destination host by using '-u' [which will update the changes] variable with SCP.

please feel free to ask for any help, if answer is yes to "so your writable volumes has a storage which is attached to ESX host as datastore right?" Smiley Happy

Reply
0 Kudos