HackToday Walk Blog


  • Home

  • Tags

  • Archives

  • Search

关于virtualbox的 4.2.0的一个问题(guest os redhat 6.4)

Posted on 2013-07-20

问题:
如果你使用virtualbox 4.2.0会发现一个问题,安装完redhat 6.4操作系统后,安装增强功能时,无法正常的编译,

1
error: unknown field ‘reclaim_buffers’ specified in initializer

这个是virtualbox的一个bug,参看

https://www.virtualbox.org/ticket/11586

解决方法:

link中提到了,修改

1
sudo vi /usr/src/vboxguest-4.2.0/vboxvideo/vboxvideo_drm.c

如下

1
2
3
109 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0)
110 // .reclaim_buffers = drm_core_reclaim_buffers,
111 #endif

然后,运行

1
/etc/init.d/vboxadd setup

这样就可以正常的编译了。你不可以运行那个install脚本,因为那样会把修改的再次用原始的代码覆盖,编译还是会失败。

其他问题:

好像这个版本的增强功能,还有其他问题,编译成功也无法使用无缝模式的。
估计这个版本没有对redhat 6.4测试过或者不正式支持,无从得知。

创建ISO映像解决问题

Posted on 2013-07-20
  1. 问题来源:

    我找不到原始的iso镜像了,只在一台机器上发现拷贝的文件,所以我需要利用这些文件制作成iso来安装。

  2. 最初的参考资料:

如果参考 http://linuxlookup.com/howto/create_iso_image_file_linux中的mkisofs方法
在制作ISO的时候会遇到问题,无法正常的boot

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Steps to follow
Create an ISO image from optical media
In this example, we're going to copy the contents of a disk in the CD/DVD drive (/dev/cdrom) to an ISO image file. Open a terminal window and type the following at the command line.

dd if=/dev/cdrom of=/directory/example.iso

Notations:
- dd is the program used to convert and copy a file.
- if defines an input file.
- of defines an output file.
- iso is the resulting ISO image file.
Create an ISO image from files in a directory
To create an ISO image from files within a directory is just as simple. State an output directory and name of the ISO to create, along with a source directory. For example:

mkisofs -o /home/linuxlookup/example.iso /source/directory/
  1. 问题:

关于从directory制作iso会遇到几个问题,

  • “mkisofs: Uh oh, I cant find the boot catalog directory “

需要确保,isolinux/isolinux.bin 和 isolinux/boot.cat 相对应的iso目录正确
参考:
http://www.linuxquestions.org/questions/linux-software-2/mkisofs-returns-error-mkisofs-uh-oh-i-cant-find-the-boot-catalog-directory-844905/

  • boot image ‘./isolinux/isolinux.bin’ has not an allowable size.

这个是因为默认的是floppy,解决方法
你需要加入: -hard-disk-boot 或者 -no-emul-boot.
参考:
http://www.linuxquestions.org/questions/red-hat-31/mkisofs-error-boot-image-%27-isolinux-isolinux-bin%27-has-not-an-allowable-size-358439/

  1. 解决方法:

我的例子(redhat x86_64 6.4 ISO):

1
sudo mkisofs  -o ~/images/rhels64.iso  -b isolinux/isolinux.bin  -c  isolinux/boot.cat -no-emul-boot -boot-info-table -l -r -J -v -allow-lowercase ~/images/rhels6.4/x86_64/

说明:关于link中给出的 -boot-load-size 4,这个我的没有指出也可以,是因为,

1
2
-boot-load-size load_sectors   Specifies the number of "virtual" (512-byte) sectors to load in no-emulation mode. 
The default is to load the entire boot file. Some BIOSes may have problems if this is not a multiple of 4.

谈谈Nova(osapi_compute)-extension

Posted on 2013-07-04
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
[composite:osapi_compute]
use = call:nova.api.openstack.urlmap:urlmap_factory
/: oscomputeversions
/v1.1: openstack_compute_api_v2
/v2: openstack_compute_api_v2



[composite:openstack_compute_api_v2]
use = call:nova.api.auth:pipeline_factory
noauth = faultwrap sizelimit noauth ratelimit osapi_compute_app_v2
keystone = faultwrap sizelimit authtoken keystonecontext ratelimit osapi_compute_app_v2
keystone_nolimit = faultwrap sizelimit authtoken keystonecontext osapi_compute_app_v2


[app:osapi_compute_app_v2]
paste.app_factory = nova.api.openstack.compute:APIRouter.factory

1) #create wsgi service

1
server = service.WSGIService('osapi_compute')   --->

2)# load WSGI applications from paste configurations

1
2
wsgi.Loader()
self.app = self.loader.load_app(name) --->

3) # urlmap_factory,

1
2
3
4
for path, app_name in local_conf.items():
path = paste.urlmap.parse_path_expression(path)
app = loader.get_app(app_name, global_conf=global_conf) --->
urlmap[path] = app

4) #pipeline_factory

1
2
3
4
5
app = loader.get_app(pipeline[-1])   -->
filters.reverse()
for filter in filters:
app = filter(app)
return app

这里的重要之处在于,通过app = filter(app) 将后面的filter app作为前面的middleware的构造初始化,从而形成整个call stack,比如

1
2
keystone = faultwrap sizelimit authtoken keystonecontext ratelimit osapi_compute_app_v2
app = ratelimit(osapi_compute_app_v2)

这样ratelimit middleware的就会call osapi_compute_app_v2,
所以 3) 返回了第一个middleware的urlmap,从而 WSGI server可以在接收到/v2/***
进入middleware的 call stack ,最终根据APIRouter的url和controller的映射配置,进行API 的request的具体处理。

5) #APIRouter

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
  class APIRouter(nova.api.openstack.APIRouter):
ExtensionManager = extensions.ExtensionManager


nova.api.openstack.APIRouter --->
if ext_mgr is None:
if self.ExtensionManager:
ext_mgr = self.ExtensionManager() --->
else:
raise Exception(_("Must specify an ExtensionManager class"))
mapper = ProjectMapper()
self.resources = {}
self._setup_routes(mapper, ext_mgr) (6)
self._setup_ext_routes(mapper, ext_mgr) (7)
self._setup_extensions(ext_mgr) (8)


:ExtensionManager
self._load_extensions() --->
load_extension() --->

:ExtensionDescriptor

ext_mgr.register(self)


:ExtensionManager

def _load_extensions(self):
"""Load extensions specified on the command line."""

extensions = list(self.cls_list)

for ext_factory in extensions:
try:
self.load_extension(ext_factory)
except Exception as exc:
LOG.warn(_('Failed to load extension %(ext_factory)s: '
'%(exc)s') % locals())


After all extensions have been loaded, (those extensions are configured in nova.conf, for example,
osapi_compute_extension=nova.api.openstack.compute.contrib.standard_extensions

6) self._setup_routes(mapper, ext_mgr)

1
for openstack core api, setup necessary routes

7) self._setup_ext_routes(mapper, ext_mgr)

1
2
3
4
5
6
7
8
9
10
11
12
for each resource in  ext_mgr.get_resources()  

wsgi_resource = wsgi.Resource(resource.controller,
inherits=inherits)

:Resource
self.register_actions(controller)

# Generate routes for a controller resource
# mapping a resource is about handling creating, viewing, and editing that resource

mapper.resource(resource.collection, resource.collection, **kargs)

8) self._setup_extensions(ext_mgr)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
for each extension in returned ControllerExtension objects
get_controller_extensions
...
resource = self.resources[collection]
resource.register_actions(controller)
resource.register_extensions(controller)



:ExtensionDescriptor (append here for easy reference)

def get_resources(self):
"""List of extensions.ResourceExtension extension objects.

Resources define new nouns, and are accessible through URLs.

"""
resources = []
return resources

def get_controller_extensions(self):
"""List of extensions.ControllerExtension extension objects.

Controller extensions are used to extend existing controllers.
"""
controller_exts = []
return controller_exts

9) manage a WSGI server, serving a WSGI application —>

1
2
3
4
5
self.server = wsgi.Server(name,
self.app,
host=self.host,
port=self.port)
service.serve(server, workers=server.workers)

devstack 的 glance-api启动失败的原因

Posted on 2013-06-20

devstack 更新了一下,在recllone的时候,发现有个现象 glance-api 无法响应请求。

经过调查发现,原来自己的在glance文件目录下创建过bin (glance 从havana取消bin目录了)当时是import 到
eclipse工程中用来调试用的。 devstack reclone 不会删除新创建的目录,所以导致glance-manage db_sync失败,
导致没有数据库glance。所以api请求导致meta query失败,500错误。

智能钱包的故事

Posted on 2013-05-14

爱范网一个不错的文章介绍了胡俊峰团队的智能钱包设计,很有意思。

物联网虽然提了很久,感觉好多是些原型系统。感知计算以Google class为代表引发了一系列的革新,智能手表,智能腕带等。
在这个移动互联网横行的年代,越来越多的创新来自于移动生活,smart life 就是给你带了生活方式的一种改变,这种改变给人们普通的生活增添了一些乐趣和互动,我觉得这便是很大的进步了。

期待看到更多类似智能钱包的产品出现,移动正在改变生活。

Devstack下的ceilometer无法统计cinder数据

Posted on 2013-05-07

前言解释:

Devstack:快捷搭建openstack开发环境的工具
ceilometer: Openstack下的一个project,用于统计各种资源,比如instance,image等的使用情况。

问题:

启动ceilometer后会发现相关的cinder的部分没有统计。

原因:

devstack关于cinder的配置部分和ceilometer在notification相关的的exchange name的配置不同。
在cinder.conf中,

1
control_exchange=openstack

而在ceilometer的ceilometer.conf中,默认的是

1
cinder_control_exchange=cinder

devstack没有对这里进行特殊配置,两个exchange不一致,当然cinder的notification就不会被收到。 ceilometer就无法更新cinder使用的情况。

解决方法:

修改cinder.conf中的exchange name为cinder,重新启动cinder相关的服务,即可。

追寻生命的意义

Posted on 2013-04-27

弗兰克尔继弗洛伊德精神分析,阿德勒个体心理学之后的 “维也纳第三心理治疗学派”的意义治疗的创始人。

追寻生命的意义一书以作者在纳粹集中营的经历为例,介绍了意义治疗的方法和理论,对于理解不同心理状态案例治疗和
人生的重新认识具有很好的说明指导作用。

IT人们读了也对自己的人生有了新的理解。

注:博文站点没有合适的分类,只能选个尽可能接近的,下次得向管理员反映一下。呵呵。

Windows 技巧可以运用在工作中

Posted on 2013-04-18

http://www.zhihu.com/question/20592820/answer/16134146

很不错的介绍,虽然用windows 7, 但有的还真不知道快捷切换。

DB2 修改字段允许为NULL

Posted on 2013-04-16

DB2 修改允许 null

因为有的column会有constraint约束,所以无法直接drop not null
必须先删除constraint,具体如下:

  1. select CONSTNAME, type from SYSCAT.TABCONST where TABNAME=’T’

T 是table的名字,大写

  1. 找到对应的constraint名字

然后执行,

1
alter table T drop unique 'unique name'
  1. 然后对表的字段drop not null
1
alter table T ALTER  'field name' drop not null
  1. 然后reorg table
1
reorg table T

参考资料:

http://bytes.com/topic/db2/answers/690847-how-change-column-not-null-null

百望山到植物园徒步穿越

Posted on 2013-04-04

从黑山扈出发,(这个口进去不用门票)沿着百望山脉一直走,林中前人踏出来的路不是很宽敞,
而且多地都不平坦,所以很多路程还是考验耐力和体力的。

也记不清楚到底翻过几座山了,走的最快的是沿着山脊的那几段,后面走了一段迂回路。
在路上遇上了一群学生和家长,有段下山的坡比较陡,他们的队伍就拉好绳子一个一个下,
十几个人大概用了半个多小时下坡。我们在他们后面,考虑到前面那条路被他们的人占据了,
而且因为年龄小的学生走的比较慢,于是我们绕过他们走的那条道下去,所以绕了一段距离。

3个小时后,我们就翻山到植物园的地界了,临近12:30,我们补充了一下水和食物。继续行进,
后面的一段距离很多盘山路,所以很耗费体力,大概1个多小时后,就到植物园里面了,
然后我们找到去香山的山路,准备继续前行。大概走了不到1个小时,天工作雨,不一会就下大了。
考虑到雨天山路滑,而且到香山的距离还有两座山,现在的体力恐怕不够支撑。
我们商量了决定返回植物园,结束行程。

回来的路上虽有点遗憾,但基本完成了穿越行程,身体拉了炼,玩的比较尽兴。好了,吃火锅,不写了。

1…141516…26

Kai Qiang Wu

This is a place for thinking and writing

253 posts
32 tags
GitHub
© 2020 Kai Qiang Wu
Powered by Hexo
|
Theme — NexT.Gemini v5.1.4
Visitor Total Visit