Blog Posts

KVM guest and host cpu binding

kvm虚拟出来的虚拟机(vm)是运行在单独的一个逻辑cpu还是可以分别在各个cpu之间运行?虚拟机cpu(vcpu)是什么概念?物理机(host)怎么看待kvm和vcpu? 为了搞懂这个概念我们还是要回到命令行中看。举例说明: 我这里有一个虚拟机叫core8,它含有8个虚拟cpu它的进程编号是20736。 就是说core8在host看来就是一个进程而已,这个集成的编号是20736.那么现在提出一个问题,这个core8的8个vcpu是怎么个情况呢?在哪里运行呢?这时还是得借助命令行。我们在host里使用ps指令,但是不能单纯用ps,还要借助于参数: ps -eL (e的意思是打印所有进程,L的意思是连县城也不放过)。我这里只显示一下和我们的20736进程相关的信息: kvm虚拟机vcpu资源绑定_第1张图片 你会看到和20736相关的有九行,那么这九行是什么呢?首先第一列都是20736,第二列里只有第一行是20736,后面的都不是。那么我们这时就应该明白了,对于host来说,kvm虚拟机是一个进程(20736),虚拟机的vcpu都是这个进程衍生出来的线程。这就是为什么除了20736还有另外八行的原因。 那么我们接着询问,这八个线程是跑在同一个逻辑cpu里吗?为了回答这个问题,我们接着做实验:

Read More

How to enable custom-domain and readmore in Hexo

What’s is Hexo ? according to the official introduction its a blog framework, have more than 20k forks and large user base.

Read More

Add route for VirtualBOX hostonly ifs

最近在使用Mac上的VirtualBox 创建出的虚拟机做K8S相关的开发工作, 物理机有时重启后无法连接到虚拟机当中,ICMP拒绝, 但是在VM 内部以及VM间网络通信都是正常的。重启Mac后问题可以解决,但是不是解决问题之道,经过排查,发现Mac上的到虚拟机hostonly 网络的路由丢失,导致连接失败 查看当前物理机上的hostonly 网卡信息 $ VBoxManage list hostonlyifs Name: vboxnet0 GUID: 786f6276-656e-4074-8000-0a0027000000 DHCP: Disabled IPAddress: 192.

Read More

Use teamsql in CloudFoundry

Most of cloudfoundry based platform have postgres service in their catalog, applications can use the credentials bounded to their running environment for accessing, but sometimes the administrator need to access the database instance for whatever reason, debugging or checking specific record.

Read More

Enable screen tabs name

This introduction will outline specifically on how to show tab name on an active screen

Read More