Thứ Hai, 23 tháng 11, 2015

Shift + Delete

Tôi vừa repair lại con PC chạy Windows 7 và xóa đi những thứ mà mình đã tích được từ rất lâu. Những thứ thường dùng nhưng lại không mang lại lợi ích gì cho tôi trong công việc và cuộc sống. 
Xóa đi trong cảm giác nhẹ tênh và thoải mái. 

Đón chờ những thách thức và cơ hội mới.

Thứ Bảy, 21 tháng 11, 2015

Openstack, QoS and CEPH RBD

Bài này được làm theo guide sau:
http://www.sebastien-han.fr/blog/2013/12/23/openstack-ceph-rbd-and-qos/

Có mấy thông số có thể áp cho volume:

  • total_bytes_sec: the total allowed bandwidth for the guest per second
  • read_bytes_sec: sequential read limitation (bytes/s)
  • write_bytes_sec: sequential write limitation
  • total_iops_sec: the total allowed IOPS for the guest per second
  • read_iops_sec: random read limitation
  • write_iops_sec: random write limitation

- Chuẩn bị 1 instance, tạo 1 disk default và attach vào instance.

- Tạo partion, tạo filesystem và mount vào sử dụng
- Test:
$ dd if=/dev/zero of=test.img bs=1M count=50 conv=fdatasync
Sử dụng fdatasync() để flush data xuống disk ( thay vì ghi tạm vào memorry buffer )
http://www.informit.com/articles/article.aspx?p=23618&seqNum=5
Kết quả: ~ 20MB/s

- Tạo QoS (limit write với tốc độ ~ 2MB/s)
# cinder qos-create low-write-bytes consumer="front-end" write_bytes_sec=2000000

- Tạo volume type
# cinder type-create low-write-bytes

- Gắn volume-type với qos
# cinder qos-associate <qos_specs> <volume_type_id>

- Tạo volume để test:
# cinder create --display-name vol_limit_speed --volume-type low-write-bytes 1

- Attach volume vào instance



- Test lại và kết quả. ~ 2MB/s


Thứ Bảy, 14 tháng 11, 2015

Resize root volume Openstack instance

Quá trình resize root volume được thực hiện ngay khi launch instance, chính vì vậy mà có thể resize root volume sau khi đã launch instace.
Yêu cầu: image/instance có cloud-init
Bước làm:
- Stop instance
$ nova stop <instance-id>
- Check root volume id:
$ nova show <instance-id> | grep volumes
- Reset state volume về available
$ cinder reset-state --state available <volume-id>
- Extend volume
$ cinder extend <volume-id> <size>
- Reset state volume về in-use
$ cinder reset-state --state in-use <volume-id>
- Start instance
$ nova start <instance-id>



Kết quả: ( trước và sau )


Openstack !!!

Tôi đang tìm hiểu và học Openstack. Tôi sẽ viết các bài chia sẻ những thứ mình tìm hiểu được về Openstack.

Các link tham khảo openstack khi bắt đầu:
http://docs.openstack.org/
http://assafmuller.com/ (neutron/network)
http://www.sebastien-han.fr/blog/ (ceph+openstack)
https://mcwhirter.com.au/tags/OpenStack/
https://github.com/openstack/openstack-ansible (openstack ansible playbook)
https://www.rdoproject.org/documentation/
http://book.pythontips.com/en/latest/index.html (python)
https://docs.python.org/2/
https://vietstack.wordpress.com/

https://openstackr.wordpress.com/
Just for fun.