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

Re: [Xen-API] tap-ctl commands

  • To: xen-api@xxxxxxxxxxxxx
  • From: George Shuklin <george.shuklin@xxxxxxxxx>
  • Date: Sat, 26 May 2012 02:51:21 +0400
  • Delivery-date: Fri, 25 May 2012 22:51:23 +0000
  • List-id: User and development list for XCP and XAPI <xen-api.lists.xen.org>

I've copy that to http://wiki.xensource.com/wiki/Blktap, hope you don't against CC-BY-SA for this.

On 25.05.2012 20:34, Jonathan Ludlam wrote:
First, allocate a minor number in the kernel:
# tap-ctl allocate

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:

(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

Xen-api mailing list



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