在openstack管理的虚拟机中启动vnc时,:1 是启动不了的,似乎是被kvm已某种方式给占用了,而这种占用方式似乎并不依赖虚拟机中的vnc软件。
浏览器中的vnc性能和体验都不如vnc客户端软件
DevOps
在openstack管理的虚拟机中启动vnc时,:1 是启动不了的,似乎是被kvm已某种方式给占用了,而这种占用方式似乎并不依赖虚拟机中的vnc软件。
浏览器中的vnc性能和体验都不如vnc客户端软件
brew install spinx-build 的时候可能会遇到如下错误:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open-uri.rb:353:in `open_http': 422 Unprocessable Entity (GitHub::Error) from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open-uri.rb:709:in `buffer_open' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open-uri.rb:210:in `block in open_loop' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open-uri.rb:208:in `catch' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open-uri.rb:208:in `open_loop' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open-uri.rb:149:in `open_uri' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open-uri.rb:689:in `open' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open-uri.rb:30:in `open' from /usr/local/Library/Homebrew/utils.rb:367:in `open' from /usr/local/Library/Homebrew/utils.rb:397:in `issues_matching' from /usr/local/Library/Homebrew/utils.rb:425:in `issues_for_formula' from /usr/local/Library/Homebrew/exceptions.rb:145:in `fetch_issues' from /usr/local/Library/Homebrew/exceptions.rb:141:in `issues' from /usr/local/Library/Homebrew/exceptions.rb:184:in `dump' from /usr/local/Library/brew.rb:167:in `rescue in <main>' from /usr/local/Library/brew.rb:65:in `<main>' |
修改 /usr/local/Library/Homebrew/utils.rb 的代码,打印url看看:
1 |
https://api.github.com/search/issues?q=sphinx+repo:Homebrew/homebrew+in:title+state:open&per_page=100 |
莫非访问不了api.github.com ?
1 2 3 4 5 6 7 8 9 10 11 12 13 |
$ curl "https://api.github.com/search/issues?q=sphinx+repo:Homebrew/homebrew+in:title+state:open&per_page=100" { "message": "Validation Failed", "errors": [ { "message": "The listed users and repositories cannot be searched either because the resources do not exist or you do not have permission to view them.", "resource": "Search", "field": "q", "code": "invalid" } ], "documentation_url": "https://developer.github.com/v3/search/" } |
看起来是有返回值的,而且是合法的json,继续看 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open-uri.rb 的代码,发现很可能是httpcode的问题:
1 |
curl -v "https://api.github.com/search/issues?q=sphinx+repo:Homebrew/homebrew+in:title+state:open&per_page=100" |
发现http code为 422 , 而/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open-uri.rb 遇到 422 是走异常逻辑的,如果能简单修改代码使其认为是正常似乎是可以的; 但是mac 不让修改/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open-uri.rb , root账号也不行
回头看 /usr/local/Library/Homebrew/utils.rb ,发现如下逻辑:
export HOMEBREW_NO_GITHUB_API=1
问题解决
其实 spinx-build 是在生成man page的时候用到的,某些情况下,大可不必非要去生成man page
软件包: libguestfs-tools
这里的 guestfish 挺不错的
1 2 3 4 5 |
# virt-df -a centos7.3.raw -h|column -t 文件系统 大小 已用空间 可用空间 使用百分比% centos7.3.raw:/dev/sda2 497M 147M 350M 30% centos7.3.raw:/dev/sda5 100M 0 100M 0% centos7.3.raw:/dev/sda6 42G 2.1G 40G 5% |
1 |
virt-ls -a centos7.3.img -l / |
1 |
virt-copy-in -a centos7.3.img /tmp/hello.txt /tmp/ |
1 |
virt-cat -a centos7.3.img /tmp/hello.txt |
virt-resize: –shrink 并不能让镜像文件变的更小(反而变大了)
virt-sparsify 可以使得一个镜像文件变成一个稀疏文件,对于发布、存储镜像很有必要
http://blog.replicated.com/refactoring-a-dockerfile-for-image-size/
1. 尽量减少不必要的包
2. 包管理器自动安装的包不一定都是必须的,可能只是建议安装
参考:
按照下面参考中的做法,添加一个认证的中间件就可以搞定
参考: https://docs.openstack.org/keystone/latest/advanced-topics/external-auth.html