iSCSI Differencing disks by snapshot?

iSCSI Differencing disks doable on freenas?

  • Might be done using snapshots

    Votes: 0 0.0%
  • Nah, better to implement that in isgt itself

    Votes: 0 0.0%
  • Not even in the near future....

    Votes: 0 0.0%

  • Total voters
    0
Status
Not open for further replies.

Tsaukpaetra

Patron
Joined
Jan 7, 2014
Messages
215
I have a somewhat stupid idea I wanted to throw out there.
Since ZFS is supposed to be copy-on-write, could I take a snapshot of a dataset that contains a single file-extent, and then use cloned snapshots as a file-extent target?

Instinct says no, it would effectively be the same as dd'ing the file extent anyway, but I thought to ask just in case it could be a thing.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
You absolutely can. For example, I did this about 6 months ago:

1. Had an iSCSI extent shared with ESXi. It contained 2 VMs.
2. A daily snapshot occurred
3. I deleted one of the two VMs.
4. I realized I didn't want to delete it after all
5. Cloned the snapshot from the previous day, then added the file to the iSCSI service and did the required setup.
6. Mounted the second iSCSI extent.
7. Copied the VM from step 3 that was deleted from the cloned dataset to the orignal.
8. Undid the changes from step 5 and 6 after the copying finished.
 

Tsaukpaetra

Patron
Joined
Jan 7, 2014
Messages
215
You absolutely can.
Huh, didn't expect that. However, will it still work like a differencing disk in that manner?

Like, say I have that snapshot of the file, I clone the snapshot and make changes to it. Only the changes are saved, right? (i.e. only the three bytes that were modified are written to disk, not a copy of the 80 Gb disk).
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Correct. But keep in mind that, in your example, the three bytes you wrote to the disk are going to be written to a different data block (woohoo for COW) and the snapshot will now point to the old three bytes.
 

Tsaukpaetra

Patron
Joined
Jan 7, 2014
Messages
215
I think that will be fine. I intend to basically create a "Master snapshot" of an OS disk as a template for all of my iSCSI-booting computers, then make a clone of this snapshot for each PC.
That way I don't automatically lose 80 Gb per PC a the get-go, and I can have a lot of PCs that will only take 80 Gb + whatever has changed across all of the different machines.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
You'd have to setup clones and stuff. I definitely wouldn't recommend what you are wanting to do for production.
 

Tsaukpaetra

Patron
Joined
Jan 7, 2014
Messages
215
You'd have to setup clones and stuff. I definitely wouldn't recommend what you are wanting to do for production.
That's partially what I'm saying, since all of the cloned snapshots would depend on the original snapshot, and I would think performance of the clones would start to decrease as the different disks change more and more over time (especially with the pagefile being part of the snapshot-ed disks).
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
That's partially what I'm saying, since all of the cloned snapshots would depend on the original snapshot, and I would think performance of the clones would start to decrease as the different disks change more and more over time (especially with the pagefile being part of the snapshot-ed disks).

That's also why I don't recommend it. You'll start of with this "damn.. I'm saving SOOOO much space with this very convoluted but working setup" and you'll find that in just a few weeks or months (depending on usage) you didn't save hardly any space at all, but you have a very convoluted (and fragile) setup to maintain.

What you are doing is kind of like a "poor man's dedup". You're deduping the data for free with the clones. But in the long term once the data has been moved around your savings are gone. :(

It makes a great experiment, but in production, not just no... hell f*** no!
 

Tsaukpaetra

Patron
Joined
Jan 7, 2014
Messages
215
That's also why I don't recommend it. You'll start of with this "damn.. I'm saving SOOOO much space with this very convoluted but working setup" and you'll find that in just a few weeks or months (depending on usage) you didn't save hardly any space at all, but you have a very convoluted (and fragile) setup to maintain.

What you are doing is kind of like a "poor man's dedup". You're deduping the data for free with the clones. But in the long term once the data has been moved around your savings are gone. :(

It makes a great experiment, but in production, not just no... hell f*** no!
Yeah, sounded interesting as a thought experiment, but not so much in practice. ;)

My next adventure is to create a minimally sized System disk, then symlink in folders in the Program Files directory to a network share. :eek:o_O
What could possibly go wrong? ;););););)
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
I could be wrong, but I believe that ESXi and VMWare workstation 10 let you create a "base" image and then point to that image while doing differentials for multiple machines. Not sure if you need some kind of expensive license for that feature on ESXi though.

I won't lie though, I've seen quite a few people try to come up with a process like what you are wanting to do... duplicate a base image to multiple VMs. It just doesn't seem to work well in practice with any good technology out there.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
You can absolutely do this and some people do variations on this. It is best done when the base image isn't going to be changed (much?) by the guest VM's. Virtual desktop environments in particular make every effort to leverage strategies to do this sort of thing, but it is kind of a specialized area. It is not a beginner level project.
 

HoneyBadger

actually does care
Administrator
Moderator
iXsystems
Joined
Feb 6, 2014
Messages
5,112
Virtual desktop infrastructures usually handle the cloning via some manner of integration with the hypervisor.

For example, VMware clones your gold image to a hidden "replica VM" that's attached as a read-only disk, creates and attaches a separate VMDK to the individual desktop VMs, and then uses a filter driver within the guest OS to redirect writes there. Each VM ends up only using as much additional space as it writes to disk in changed data.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Yes, but I've especially seen various hosting environments where various ZFS based strategies are used to try to implement variations that leverage ZFS copy-on-write. I'd say that many of them are less-than-truly-useful and/or doomed-to-fail, and there's been less emphasis on this as the software side has improved, and servers and storage costs have been reduced. Still, ZFS has some powerful capabilities with snapshotting and cloning.
 

Tsaukpaetra

Patron
Joined
Jan 7, 2014
Messages
215
Yeah, looks like I won't go that route that route then.
On a side note, I noticed that I can apparently have up to 18 LUNs. Does this mean I can have a maximum of 18 unique targets attached at any given moment? I don't currently have 18 computers to attempt this, but it struck me as odd when I saw it. I probably just skipped the relevant section in the manual or something. ;)
 
Status
Not open for further replies.
Top