From: "Serge E. Hallyn" <serge@hallyn.com>
To: Russell Coker <russell@coker.com.au>
Cc: SE-Linux <selinux@tycho.nsa.gov>
Subject: Re: deduplication and SE virtual machines
Date: Wed, 7 Jul 2010 15:08:56 -0500 [thread overview]
Message-ID: <20100707200856.GA20082@hallyn.com> (raw)
In-Reply-To: <201007042141.34168.russell@coker.com.au>
Quoting Russell Coker (russell@coker.com.au):
> I'm thinking of setting up a Linux virtual machine server for SE Linux
> training, and with most COW setups the initial relabel of the filesystem will
> put all the meta-data into a separate copy. So ideally there would be a way
> of deduplicating this. Also there's no guarantee that the disk blocks used
> would be the same so a simple un-COW operation on LVM or something probably
> wouldn't be a viable option.
Here's an idea - you could create the base fs as a qcow2 block device.
Create copy-on-write images based on that
for i in `seq 1 20`; do
qemu-img create -f qcow2 -b selinux-base.img selinux-vm$i.img
done
Then use qemu-nbd to export those as /dev/nbdX devices
for i in `seq 1 20`; do
qemu-nbd -c /dev/nbd$i selinux-vm$i
done
I'm guessing at the commands as I haven't quite done it. But then your
containers or VMS or chroots or whatever can mount /dev/nbd$i like a
normal block device, COW based on the same base image.
I'm not sure that would suffice though, if there are a lot of small
files, since presumably the xattrs will be spread out along with the
data. So if that does not suffice (I'd love to hear a report if anyone
tests this), then I think we have another motivator for pushing a
'xattr_file=' mount option, where the specified file has
(inode_num,name,value) triplets for the inodes on the fs, i.e.
25,security.selinux,root_u:root_r:root_t
25,security.capabilities,<whatever>
30,security.selinux,user_u:user_r:serge_t
That way the base fs wouldn't need to change much at all for each
of your VMs. The other motivator of course is common filesystems
which don't support xattrs like squashfs and CIFS. I wonder what
sort of reception such a patch would receive... "welcome back to
year 2000"?
-serge
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
next prev parent reply other threads:[~2010-07-07 20:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-04 11:41 deduplication and SE virtual machines Russell Coker
2010-07-07 20:08 ` Serge E. Hallyn [this message]
2010-07-08 2:51 ` Russell Coker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100707200856.GA20082@hallyn.com \
--to=serge@hallyn.com \
--cc=russell@coker.com.au \
--cc=selinux@tycho.nsa.gov \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.