centos7-升级至4.* 内核

因3.10内核部分功能不支持,所以考虑将CentOS 7.9 系统内核升级至 4.18

当前内核
1
unama -a
安装内核库
1
2
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
yum install -y https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm

Read More

openstack-nova-虚拟机创建流程以及源码分析(一)

openstack 虚机创建流程以及源码分析(一)

基于openstack stein
虚机创建流程图

上图是虚拟机创建流程的整体流程,可以看到整体虚拟机创建流程一次经过了API、Conductor、Scheduler、Placement、Compute等主要服务。

下表列出了每个步骤中实例的状态:

Status Task Power state Steps
Build scheduling None 3-12
Build networking None 22-24
Build block_device_mapping None 25-27
Build spawing None 28
Active none Running

Read More

openstack-记一次虚机创建失败问题

d

背景

某天,突然openstack无法创建虚拟机,MQ消息大量堆积

现象

  1. nova-conductor报大量数据库超时
1
2
3
4
5
6
7
8
9
[SQL: UPDATE services SET updated_at=%(updated_at)s, report_count=%(report_count)s, last_seen_up=%(last_seen_up)s WHERE services.id = %(services_id)s]
[parameters: {'last_seen_up': datetime.datetime(2022, 8, 9, 11, 4, 54, 153870), 'services_id': 7, 'updated_at': datetime.datetime(2022, 8, 9, 11, 4, 54, 256605), 'report_count': 2340897}]
(Background on this error at: http://sqlalche.me/e/e3q8)
2022-08-09 19:05:00.293 67 ERROR nova.servicegroup.drivers.db Traceback (most recent call last):
2022-08-09 19:05:00.293 67 ERROR nova.servicegroup.drivers.db File "/var/lib/kolla/venv/lib/python2.7/site-packages/nova/servicegroup/drivers/db.py", line 92, in _report_state
2022-08-09 19:05:00.293 67 ERROR nova.servicegroup.drivers.db service.service_ref.save()
2022-08-09 19:05:00.293 67 ERROR nova.servicegroup.drivers.db File "/var/lib/kolla/venv/lib/python2.7/site-packages/oslo_versionedobjects/base.py", line 226, in wrapper
2022-08-09 19:05:00.293 67 ERROR nova.servicegroup.drivers.db return fn(self, *args, **kwargs)
2022-08-09 19:05:00.293 67 ERROR nova.servicegroup.drivers.db File "/var/lib/kolla/venv/lib/python2.7/site-packages/nova/objects/service.py", line 406, in save

2.

openstack-nova-虚拟机热迁移过程源码刨析

热迁移主要包括三个阶段:

  • pre_live_migration 阶段:热迁移前的准备阶段,主要在目的计算节点上提前准备虚拟机资源,包括网络资源,例如:建立虚拟机的网卡,然后将网卡加入 OvS br-int 网桥。如果该阶段失败,会有回滚操作。
  • 内存迁移阶段:该阶段完全虚拟机虚拟内存数据的迁移,如果虚拟机的系统盘在计算节点本地,那么系统盘数据也会在此时进行迁移。如果该阶段失败,会有回滚操作,回滚流程和 pre_live_migration 阶段一致。
  • post_live_migration 阶段:热迁移完成后资源清理阶段,源计算节点主要是断开源计算节点上虚拟机的卷连接、清理源计算节点虚拟机的网卡资源;目的节点主要是调用 neutronclient,更新 Port Host 属性为目的计算节点。(NOTE:该阶段无需回滚流程,因为虚拟机实际上已经成功迁移,再回滚没有意义)

Read More

go-etcd clientv3 包冲突问题

golang 当中操作 etcd 必须 go get go.etcd.io/etcd/clientv3
但是会报错如下:

github.com/coreos/etcd/clientv3/balancer/picker

F:\Go\pkg\mod\github.com\coreos\etcd@v3.3.22+incompatible\clientv3\balancer\picker\err.go:37:44: undefined: balancer.PickOptions
F:\Go\pkg\mod\github.com\coreos\etcd@v3.3.22+incompatible\clientv3\balancer\picker\roundrobin_balanced.go:55:54: undefined: balancer.PickOptions

github.com/coreos/etcd/clientv3/balancer/resolver/endpoint

F:\Go\pkg\mod\github.com\coreos\etcd@v3.3.22+incompatible\clientv3\balancer\resolver\endpoint\endpoint.go:114:78: undefined: resolver.BuildOption
F:\Go\pkg\mod\github.com\coreos\etcd@v3.3.22+incompatible\clientv3\balancer\resolver\endpoint\endpoint.go:182:31: undefined: resolver.ResolveNowOption
大概是说原因是 google.golang.org/grpc 1.26 后的版本是不支持 clientv3 的。

Read More