mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #493 from ioito/hotfix/qx-host-server-ignore-rbd-error
避免因ceph存储阻塞host 服务启动
This commit is contained in:
@@ -269,6 +269,15 @@ func (s *SRbdStorage) withCluster(doFunc func(*rados.Conn) (interface{}, error))
|
||||
}
|
||||
}
|
||||
}
|
||||
for key, timeout := range map[string]int64{"rados_osd_op_timeout": 3, "rados_mon_op_timeout": 3, "client_mount_timeout": 3} {
|
||||
_timeout, _ := s.StorageConf.Int(key)
|
||||
if _timeout > 0 {
|
||||
timeout = _timeout
|
||||
}
|
||||
if err := conn.SetConfigOption(key, fmt.Sprintf("%d", timeout)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
if err := conn.Connect(); err != nil {
|
||||
log.Errorf("connect rbd cluster %s error: %v", s.StorageName, err)
|
||||
return nil, err
|
||||
@@ -364,7 +373,7 @@ func (s *SRbdStorage) SyncStorageInfo() (jsonutils.JSONObject, error) {
|
||||
if len(s.StorageId) > 0 {
|
||||
capacity, err := s.getCapacity()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return modules.Storages.PerformAction(hostutils.GetComputeSession(context.Background()), s.StorageId, "offline", nil)
|
||||
}
|
||||
content = map[string]interface{}{
|
||||
"name": s.StorageName,
|
||||
|
||||
Reference in New Issue
Block a user