命中有時終須有 命中無時莫強求

Debugging Saltstack States

利用 Saltstack 安裝 OpenStack Keystone。按照 OpenStack 官方安裝手冊,裝完 Keystone 之後,必須要為 Keystone 自己註冊 service 與 endpoint。

這一個步驟,我把他寫成 Saltstack states 如下:

waiting-keystone-startup:
  cmd.run:
    - name: sleep 1

registry-keystone-service:
  keystone.service_present:
    - name: keystone
    - service_type: identity
    - description: "OpenStack Identity"
    - require:
      - cmd: waiting-keystone-startup

registry-keystone-endpoint:
  keystone.endpoint_present:
    - name: keystone
    - publicurl: http://host-01:5000/v2.0
    - internalurl: http://host-01:5000/v2.0
    - adminurl: http://host-01:35357/v2.0
    - region: regionOne
    - require:
      - keystone: registry-keystone-service

結果執行時發生 KeyError:

user@host-01:/srv/salt/openstack/keystone$ salt '*' state.sls openstack.keystone.registry
host-01:
    The minion function caused an exception: Traceback (most recent call last):
      File "/usr/lib/python2.7/dist-packages/salt/minion.py", line 1161, in _thread_return
        return_data = func(*args, **kwargs)
      File "/usr/lib/python2.7/dist-packages/salt/modules/state.py", line 681, in sls
        ret = st_.state.call_high(high_)
      File "/usr/lib/python2.7/dist-packages/salt/state.py", line 2067, in call_high
        ret = dict(list(disabled.items()) + list(self.call_chunks(chunks).items()))
      File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1623, in call_chunks
        running = self.call_chunk(low, running, chunks)
      File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1769, in call_chunk
        self._mod_init(low)
      File "/usr/lib/python2.7/dist-packages/salt/state.py", line 612, in _mod_init
        self.states['{0}.{1}'.format(low['state'], low['fun'])]  # pylint: disable=W0106
      File "/usr/lib/python2.7/dist-packages/salt/utils/lazy.py", line 90, in __getitem__
        raise KeyError(key)
    KeyError: 'keystone.service_present'

Read more...

解決 qcow2 image : Could not read snapshots. File too large

在 KVM VM running 的中,執行了 qemu-img snapshot -c ....,可能是沒有算好 image 的剩餘空間,也可能是某種 bug,總之,當 VM 關機後,就再也開不起來了。

qemu-img info 會產生錯誤:

Host1 # qemu-img info portal.img
qemu-img: Could not open 'portal.img': Could not read snapshots: File too large

Read more...

IPv6 Neighbour table overflow

這兩天一直在 syslog 上看到 Neighbour table overflow

Apr 30 06:27:03 host-42 kernel: [72924.290265] net_ratelimit: 1739 callbacks suppressed
Apr 30 06:27:03 host-42 kernel: [72924.290269] IPv6: Neighbour table overflow

每兩分鐘就出現6~7筆,數量非常的多 如果不處理它,放任它繼續增長,過一兩天後系統就會 kernel panic。

Read more...

OpenStack Glance Image-list 401

架設 OpenStack Juno ,安裝完 Glance 後進行測試時,glance 指令會一直出現 401 錯誤。

root@localhost:~# glance --debug image-list
curl -i -X GET -H 'User-Agent: python-glanceclient' -H 'Content-Type: application/octet-stream' -H 'Accept-Encoding: gzip, deflate, compress' -H 'Accept: */*' -H 'X-Auth-Token: ***' http://140.114.91.220:9292/v1/images/detail?sort_key=name&sort_dir=asc&limit=20
Request returned failure status 401.
Invalid OpenStack Identity credentials.

Read more...

暴力啟用 gitlab user

下這個標題不知道是不是很奇怪XD

最近在為自己的 team 開發一個 management 系統,於是決定在 gitlab 上開 project。用了 team 的 email 註冊,但是不知道為什麼總是收不到驗證信。於是…不小心找了個旁門左道 XD

Read more...

Page 3 of 4