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

[Xen-devel] [RFC]Some questions about xen-4.1.1



Hi list,

Maybe i should not ask questions here. If true, please forgive me ;-)


I build xen environment under Centos-5.4.My env is like this.

[2012-02-25 23:51:19 4789] INFO (XendDomainInfo:3269) Mounting
/home/jiawei/workshop1/1.sys.img on /dev/xvdp.
[2012-02-25 23:51:19 4789] DEBUG (DevController:95) DevController:
writing {'backend-id': '0', 'virtual-device': '51952',
'device-type': 'disk', 'state': '1', 'backend':
'/local/domain/0/backend/vbd/0/51952'} to
/local/domain/0/device/vbd/51952.
Linux local00212201021a.zte.com.cn 2.6.32.39 #1 SMP Sun Feb 19
11:21:09 CST 2012 x86_64 x86_64 x86_64 GNU/Linux
# xm info
host                   : local00212201021a.zte.com.cn
release                : 2.6.32.39
version                : #1 SMP Sun Feb 19 11:21:09 CST 2012
machine                : x86_64
nr_cpus                : 2
nr_nodes               : 1
cores_per_socket       : 2
threads_per_core       : 1
cpu_mhz                : 1795
hw_caps                :
bfebfbff:20100800:00000000:00000940:0000e31d:00000000:00000001:00000000
virt_caps              :
total_memory           : 984
free_memory            : 665
free_cpus              : 0
xen_major              : 4
xen_minor              : 1
xen_extra              : .1
xen_caps               : xen-3.0-x86_64 xen-3.0-x86_32p
xen_scheduler          : credit
xen_pagesize           : 4096
platform_params        : virt_start=0xffff800000000000
xen_changeset          : unavailable
xen_commandline        :
cc_compiler            : gcc version 4.1.2 20080704 (Red Hat 4.1.2-51)
cc_compile_by          : root
cc_compile_domain      : zte.com.cn
cc_compile_date        : Thu Feb 23 23:32:01 CST 2012
xend_config_format     : 4


================================
[a] We get an error by running following steps.
================================
1, Making a delta plate by vhd-util
# vhd-util snapshot -n /home/jiawei/workshop1/1.sys.img -p
/home/jiawei/workshop1/domU-x86_64-FS.img -m

2ïstart a domu
# xm cr pygrub.conf
Using config file "./pygrub.conf".
Error: Disk isn't accessible

# cat pygrub.conf
name = "ttylinux"
memory = 512
vcpus = 1
vif = [ 'bridge=virbr0' ]
on_reboot = 'restart'
on_crash = 'restart'
bootloader = "/usr/bin/pygrub"
disk = ['tap2:vhd:/home/jiawei/workshop1/1.img,sda,w']

Be sure we have a correct raw image
/home/jiawei/workshop1/domU-x86_64-FS.img becasue
we have tested it. But in this condition we can get a tapdisk device.
Details are here.

[root@local00212201021a workshop1]# tap-ctl create -a
vhd:/home/jiawei/workshop1/1.img
/dev/xen/blktap-2/tapdev0
[root@local00212201021a workshop1]# tap-ctl list
    5835  0    0        vhd /home/jiawei/workshop1/1.img


At last we take some xen logs from directory /var/log/xen/xen.log like this.

...
[2012-02-25 23:51:19 4789] DEBUG (XendDomainInfo:103)
XendDomainInfo.create(['vm', ['name', 'ttylinux'], ['memory', 512],
['on_reboot', 'restart'], ['on_crash', 'restart'], ['on_xend_start',
'ignore'], ['on_xend_stop', 'ignore'], ['vcpus', 1], ['oos', 1],
['bootloader', '/usr/bin/pygrub'], ['bootloader_args', '-q'],
['image', ['linux', ['videoram', 4], ['tsc_mode', 0], ['nomigrate',
0]]], ['s3_integrity', 1], ['device', ['tap2', ['uname',
'tap2:vhd:/home/jiawei/workshop1/1.sys.img'], ['dev', 'xvda'],
['mode', 'w']]], ['device', ['vif', ['bridge', 'virbr0']]]])
[2012-02-25 23:51:19 4789] DEBUG (XendDomainInfo:2498)
XendDomainInfo.constructDomain
[2012-02-25 23:51:19 4789] DEBUG (balloon:187) Balloon: 541836 KiB
free; need 16384; done.
[2012-02-25 23:51:19 4789] DEBUG (XendDomain:476) Adding Domain: 34
[2012-02-25 23:51:19 4789] DEBUG (XendDomainInfo:2836)
XendDomainInfo.initDomain: 34 256
[2012-02-25 23:51:19 4789] INFO (XendDomainInfo:3269) Mounting
/home/jiawei/workshop1/1.sys.img on /dev/xvdp.
[2012-02-25 23:51:19 4789] DEBUG (DevController:95) DevController:
writing {'backend-id': '0', 'virtual-device': '51952', 'device-type':
'disk', 'state': '1', 'backend':
'/local/domain/0/backend/vbd/0/51952'} to
/local/domain/0/device/vbd/51952.
[2012-02-25 23:51:19 4789] DEBUG (DevController:97) DevController:
writing {'domain': 'Domain-0', 'frontend':
'/local/domain/0/device/vbd/51952', 'uuid':
'6772f76d-11b0-246e-b483-e9fc1056df13', 'bootable': '0', 'dev':
'/dev/xvdp', 'state': '1', 'params': '/dev/xen/blktap-2/tapdev1',
'mode': 'r', 'online': '1', 'frontend-id': '0', 'type': 'phy',
'tapdisk-params': 'vhd:/home/jiawei/workshop1/1.sys.img'} to
/local/domain/0/backend/vbd/0/51952.
[2012-02-25 23:51:19 4789] DEBUG (DevController:144) Waiting for 51952.
[2012-02-25 23:51:19 4789] DEBUG (DevController:628)
hotplugStatusCallback
/local/domain/0/backend/vbd/0/51952/hotplug-status.
[2012-02-25 23:51:20 4789] DEBUG (DevController:628)
hotplugStatusCallback
/local/domain/0/backend/vbd/0/51952/hotplug-status.
[2012-02-25 23:51:20 4789] DEBUG (DevController:642) hotplugStatusCallback 1.
[2012-02-25 23:51:20 4789] DEBUG (DevController:144) Waiting for 51952.
[2012-02-25 23:51:20 4789] DEBUG (DevController:628)
hotplugStatusCallback
/local/domain/0/backend/vbd/0/51952/hotplug-status.
[2012-02-25 23:51:20 4789] DEBUG (DevController:642) hotplugStatusCallback 1.
[2012-02-25 23:51:20 4789] ERROR (XendBootloader:43) Disk isn't accessible
...

We think that there are something wrong with the device /dev/xvdp. And
its *DevController* process
51952 can not get its corrective status for hotplug. So error happens
to us. Right?


=================================================
[b]But we can launch a domu like following steps successfully
=================================================

1, Tap-ctl create a device
# tap-ctl create -a vhd:/home/jiawei/workshop1/1.img
/dev/xen/blktap-2/tapdev0
# tap-ctl list
5835  0    0        vhd /home/jiawei/workshop1/1.img

2, Start domu
# xm cr pygrub1.conf
Using config file "./pygrub1.conf".
Started domain ttylinux (id=44)
# cat pygrub1.conf
memory = 512
name = "ttylinux"
bootloader = "/usr/bin/pygrub"
disk = ['phy:/dev/xen/blktap-2/tapdev0,xvda1,w']

By up steps, we do get a domu. Could anyone tell me the detail
differences between
[a] and [b]? Why does [a] lead to an error? And [b] is always right for us?


===========================
[c] Some other confusions
===========================
Sometimes i can not get a device by 'tap-ctl create  -a args'. It says
i happen to some
errors. After i do separate steps of 'tap-ctl create', it looks well
for me. I will show you
a concrete example.

the wrong way
------------------------
# tap-ctl create -a tap2:vhd:/home/jiawei/workshop1/1.sys.img
# tap-ctl list
# tap-ctl create -a tapdisk:vhd:/home/jiawei/workshop1/1.sys.img
# cat /var/log/messages | tail -20
...
Feb 25 22:50:20 local00212201021a tapdisk2[1171]: I/O queue driver: lio
Feb 25 22:50:20 local00212201021a tapdisk2[1171]: received 'attach'
message (uuid = 0)
Feb 25 22:50:20 local00212201021a tapdisk2[1171]: sending 'attach
response' message (uuid = 0)
Feb 25 22:50:20 local00212201021a tapdisk2[1171]: received 'open'
message (uuid = 0)
Feb 25 22:50:20 local00212201021a tapdisk2[1171]: sending 'error'
message (uuid = 0)
Feb 25 22:50:20 local00212201021a tap-ctl: tap-err:tap_ctl_open: open
failed, err -2
Feb 25 22:50:20 local00212201021a tapdisk2[1171]: received 'detach'
message (uuid = 0)
Feb 25 22:50:20 local00212201021a tapdisk2[1171]: sending 'detach
response' message (uuid = 0)
.....


the right way
--------------------
[root@local00212201021a workshop1]# tap-ctl attach
usage: attach <-p pid> <-m minor>
[root@local00212201021a workshop1]# tap-ctl list
    1194  -    -          - -
[root@local00212201021a workshop1]# tap-ctl attach -p 1194 -m 0
[root@local00212201021a workshop1]# tap-ctl list
    1194  -    -          - -
[root@local00212201021a workshop1]# tap-ctl allocate
/dev/xen/blktap-2/tapdev0
[root@local00212201021a workshop1]# tap-ctl list
    1194  -    -          - -
       -  0    -          - -
[root@local00212201021a workshop1]# tap-ctl attach -p 1194 -m 0
[root@local00212201021a workshop1]# tap-ctl list
    1194  0    0          - -
[root@local00212201021a workshop1]# tap-ctl open
usage: open <-p pid> <-m minor> <-a args>
[root@local00212201021a workshop1]# tap-ctl open -p 1194 -m 0 -a
vhd:/home/jiawei/workshop1/1.sys.img
[root@local00212201021a workshop1]# tap-ctl list
    1194  0    0        vhd /home/jiawei/workshop1/1.sys.img


After 'the wrong way' and 'the right way', i think the two ways have
different mechanisms. But i
don't understand them clearly. Cloud anyone tell me the ones ?

-- 
Thanks
Harry Wei

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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