[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-API] tap-ctl commands



This  is the sequence:

First, allocate a minor number in the kernel:
# tap-ctl allocate           
/dev/xen/blktap-2/tapdev4

This is the path which will be the block device later.

Then, spawn a tapdisk process:
# tap-ctl spawn
tapdisk spawned with pid 28453

Now, you need to attach the two together:
# tap-ctl attach -m 4 -p 28453

Finally, you can open a VHD:
# tap-ctl open -m 4 -p 28453 -a vhd:/path/to/vhd

Or perhaps you'd like to open a raw file?
# tap-ctl open -m 4 -p 28453 -a aio:/path/to/raw/file

Or maybe an NBD server?
# tap-ctl open -m 4 -p 28453 -a nbd:127.0.0.1:8000

(For this last one to work you'll need a blktap from github/xen-org/blktap 
trunk-ring3 branch)

You can also open a secondary to start mirroring things to:
# tap-ctl open -m 4 -p 28453 -a vhd:/path/to/vhd -2 vhd:/path/to/mirror/vhd 

Afterwards, you'll need to tear things down. Close the tapdisk image:
# tap-ctl close -m 4 -p 28453

Detach the tapdisk process from the kernel - this also kills the tapdisk process
# tap-ctl detach -m 4 -p 28453

Now free the kernel minor number:
# tap-ctl free -m 4 

Also useful is stats querying:
# tap-ctl stats -m 4 -p 28453 

Jon



On 25 May 2012, at 12:46, Dave Scott wrote:

> (I think I sent this to the wrong list address, apologies if this comes 
> through twice)
> 
> Hi,
> 
> I'm building a proof-of-concept NFS/vhd driver-domain backend using the new 
> xapi <-> storage interface. I'm about to hook this up to tapdisk to get .vhd 
> support however I can't seem to find a manpage for "tap-ctl".
> 
> Could someone remind me what tap-ctl runes are needed to:
> 
> * get a block device suitable for blkback (i.e. "attach" a VDI in xapi-speak)
> * connect a .vhd to a blktap block device via tapdisk /or unpause a paused 
> tapdisk (i.e. "activate" a VDI)
> * disconnect a .vhd from a block device /or pause and flush buffers (i.e. 
> "deactivate")
> * remove the block device altogether (i.e. "detach")
> 
> Thanks,
> Dave
> 
> PS for anyone who's interested the code is on github:
> 
> https://github.com/djs55/dbus-test/blob/master/python/fs.py
> 
> (the storage interface code is automatically generated)
> 
> _______________________________________________
> Xen-api mailing list
> Xen-api@xxxxxxxxxxxxx
> http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api


_______________________________________________
Xen-api mailing list
Xen-api@xxxxxxxxxxxxx
http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.