Unsolved
This post is more than 5 years old
28 Posts
0
51121
December 5th, 2012 13:00
Automating connecting to a snapshot volume
On a PS4000 and a PS6100, I am creating nightly snapshots of certain volumes. Each of these snapshots create new ISCSI Targets, with unique names (there is a date-stamp in the target name).
Because of the unique name, I've had to manually connect to the target using the Windows iSCSI initiator to work with the data in the volume. Is there a way to automate this?
For example, a volume snapshot is taken at midnight every day, per schedule. At 2 am every day, I would like Windows to automatically connect to that volume to perform other actions against that data. Is this possible? Is there a way to maintain the same target name every single day?
Thanks in advance for your time!


sketchy00
203 Posts
0
December 5th, 2012 13:00
I've asked that same question quite some time ago (both for Linux VMs using the HIT/LE and the Windows VMs using HIT/ME). At the time I believe the response was something to the affect of "you can do it in python." I never followed up on it, so if you have an update, please post.
sketchy00
203 Posts
0
December 5th, 2012 14:00
I've always thought this would be such a great feature-add. (easing the ability to automatically connect to a given Snap volume for supplementary tasks such as backups). Its pretty common for even those who use great tools to leverage the vCenter API to protect all of their VMs, to have to cobble together some other strategies for their guest attached volumes. I have 12TB of Linux guest attached volumes that I have to do this for (not to mention the Windows VMs). These Linux VMs have large guest volumes for flat file storage. I present a given snap to a backup media server, and have the backup media server mount just the snap for the purposes of backup. It works extremely well, and is very fast (relatively speaking), but is pretty much manual.
Davan
28 Posts
0
December 5th, 2012 14:00
I've read some posts saying you can script in Powershell or in the EQ's CLI, a way to change the target name. But only AFTER the target is already created with its unique name. I am hoping there is a more elegant solution... Thanks for your reply!
sketchy00
203 Posts
0
December 5th, 2012 15:00
Yeah, the trick is the "easily parse" part so that one can used it for identifying and controling the correct snap, for the purposes of establishing a connection. Then its just simple mounting, etc. via bash. Last time I gave it a go was before HIT/LE 1.1.
Lots of manual effort on the Windows side as well. I had more failures with ADBO than without, so I gave up on it. Seems like its a ripe opportunity for a little scripting magic. I tried actually mounting that NTFS volume from the Linux media server (distro supporting NTFS mounting), and it worked with correct checksums against the file after a restore. However, one will obliterate all of your ACLs, so I wouldn't advise such a route.
My apologies to the OP if I hijacked the conversation. I just had some informatin that I thought was of value.
Davan
28 Posts
0
December 5th, 2012 16:00
I really appreciate the responses here. This is super ugly, but it's what I've come up with in one afternoon of tinkering.... I'm sure I'll come up with something a little more elegant after some more time playing with it.
A simple batch file that uses iscsicli to read what targets are available. It then notices which target contains the string "snap-2012" (this will break on Jan 1st!) and logs in to that target:
@ECHO OFF
SETLOCAL
setlocal EnableDelayedExpansion
SET _count=0
FOR /F "usebackq skip=2" %%G IN (`iscsicli ListTargets`) DO (
SET /a _count = _count + 1
echo.%%G | findstr /C:"snap01-2012" 1>nul
if errorlevel 1 (
echo. Not it
) ELSE (
echo. This is it
iscsicli qlogintarget %%G
)
)
)
It's gross and I'm not proud of it... but it gets the job done for now.
sketchy00
203 Posts
0
December 5th, 2012 16:00
Hey Davan,
Cut yourself some slack buddy! ...That indeed is a great start. Cripes, it's more than I had. I've concocted my fair share of ugly scripts over the years (some of which that work, while others that don't). Putting it out there might spur others to tweak and improve it. So again, nice job, and thanks for sharing!
Don, I haven't tried HIT/LE 1.2 yet, but that is a great reason to do so. All of those features add up to it being a much more viable solution, regardless of what the backup vehicle is, or the target is (tape, DR4000, etc.)
Davan
28 Posts
0
December 6th, 2012 08:00
Thanks, guys.
So I had the snapshot run on schedule last night. The default behaviour seems to be that the snapshot created on a schedule is automatically set offline. Is there a way to change that default to Online?
Davan
28 Posts
0
December 6th, 2012 08:00
I created the schedule with the web-based Group Manager. I haven't looked at the Auto Snapshot Manager yet. I assume it has the extra options I'm looking for?