2. What is the Glance?
• OpenStack에서 운영체제 이미지를 관리
• 다양한 Hypervisor에서 사용할 수 있는 VM 이미지를 관리하고, VM에 설치된 OS를 보관 및 관리
Glance의 logical Architecture
1. glance-api로 이미지를 등록, 삭제 및 관리
2. glance-api를 사용하여, glance-registry, glacne database에 이미지를 관리
3. 이미지 등록 시, glance-registry를 통하여 glance-database에 등록
4. 등록된 이미지 사용 시, glance-database에 바로 사용 요청
3. Virtual Machine Image Type
• 하이퍼바이저의 종류에 따라 서로 다른 VM 이미지 지원
Hypervisor로 QEMU를 사용했을 때 혹은 Compute Node가 CPU 가상화를 지원하지 않는 경우 iso타입을 지원하지 않는 것
같음. 찾아보기
OpenStack에서 지원하는 Virtual Machine 이미지 종류
http://docs.openstack.org/juno/config-reference/content/iso-support.html
no Image Format Explanation
1 raw 구조화되지 않은 디스크 포맷
(가지고 있는 디스크 포맷이 확장되지 않은 구조라면 raw포맷)
2 qcow2 QEMU 에뮬레이터에 의해 지원되는 포맷
동적 확장이 가능, Copy on Write를 지원
3 vhd VMWare, Xen, Microsoft, VirtualBox 같은 Virtual Machine 모니터에 의해 사용되는 일반적인 디스
크 포맷
4 vmdk 일반적인 디스크 포맷으로, 여러 VM 모니터에 의해 지원
5 vdi VirtualBox 모니터와 QEMU 에뮬레이터에 의해 지원되는 디스크 포맷
6 iso 광학 디스크나 CD_ROM의 데이터 콘텐트를 지언하는 아카이브 포맷
7 aki Amazon 커널 이미지
8 ari Amazon 램디스크 이미지
9 ami Amazon 머신 이미지
일반적으로 사용하는 포맷
테스트 할 이미지 포맷
4. Container Format
• VM이미지가 실제 VM에 대한 메타데이터를 포함하는 파일 포맷인지를 나타냄
Container Format Type
[How to Create Glance Images ?]
• use DashBorad (Horizon)
• use CLI
no Image Format Explanation
1 bare Qcow2 이미지를 위한 포맷, 메타데이터를 포함하지 않음
2 ovf OVF(Open Virtualzation Format)을 위한 Container 포맷
3 aki Amazon 커널 이미지
4 ari Amazon 램디스크 이미지
5 ami Amazon 머신 이미지
5. Cloud OS Image
• 리눅스의 대부분의 운영체제는 오픈스택이나 아마존 AWS에서 바로 사용가능한 이미지를 제공
클라우드 전용 이미
• 운영체제를 설치한 이미지를 Glance에 등록
• Glance에 등록된 이미지를 이용해 nova 하이퍼바이저가 인스턴스 생성
(클라우드는 virualBox나 Vmware에서 생성하는 가상머신처럼 이미지를 내려받아 설치 하는 것이 아님)
프로비저닝해서 속도 빠름
지원하는 이미지
no OS URL
1 Cirros http://download.cirros-cloud.net
2 Ubuntu http://uec-images.ubuntu.com
3 Fedora https://getfedora.org/ko/cloud/download/
4 OpenSuSe 12.3 http://susestudio.com/a/YRUrwO/testing-instance-for-openstack-opensuse-12-3
5 Windows Server 2012 http://www.cloudbase.it/ws2012r2
6 RedHat https://www.rdoproject.org/Image_resources
7 기타 https://github.com/rackerjoe/oz-image-build
6. Virtual Machine Manager
virt-manager
• 레드햇에서 배포하는 free S/W
• GUI환경 제공
• Libvirt 라이브러리를 이용하여 기본적으로 KVM을 제어
• Xen, LXC도 지원
Wiki
• Create, edit, start and stop VMs
• View and control of each VM’s console
• See performance and utilization statistics for each VM
• View all running VMs and Hosts, and their live performance or resource utilizaion statistics
• Use KVM, Xen or QEMU virtual machines, running either lovally or remotely
• Use LXC containers
Virual install을 사용하여 윈도우 이미지 만들기
http://docs.openstack.org/image-guide/content/centos-image.html
virt-manager is based on libvirt and supports several Hypervisor ▶
8. Create Ubuntu Instance
[Ubuntu]
• ubuntu Cloud image 12.04
• precise-server-cloudimg-amd64-disk1.img
• https://cloud-images.ubuntu.com
14.04 trusty버전은 SSH를 사용할 때 Key-pair가 되지않아 12.04버전으로 test 진행
1. Create Glance Image
1.1. use DashBoard
9. Create Ubuntu Instance
1. Create Glance Image
1.2. use CLI
$ mkdir
$ cd images
$ wget https://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64-disk1.img
$ vi admin-openrc.sh
$ source admin-openrc.sh
$ glance image-create –name Ubuntu12.04_LTS –disk-format raw –container-format bare –is-public True –
progress < trusty-server-cloudimg-amd64-disk1.img
$ glance image-list
10. Create Ubuntu Instance
2. Create Ubuntu Instance
2.1. use DashBoard
- 프로젝트 > computing > 접근&시큐리티 > 키 패어 > 키 패어 생성 > .pem 파일로 저장
- 인스턴스 > 새로만들기 > 저장된 .pem파일을 이용해서 이미지로 인스턴스 생성하기
- 완료
2.2. use CLI
$ source demo-openrc.sh
$ ssh-keygen#키 생성
$ nova keypair-add --pub-key ~/.ssh/id_rsa.pub test-key #keypair 추가
$ nova keypair-list # 생성한 keypair확인
$ nova flavor-list # 인스턴스 생성 시 사용할 flavor 확인
$ nova image-list # 인스턴스 생성 시 사용할 image 확인
$ neutron net-list # 인스턴스 생성 시 사용할 network 확인
$ nova secgroup-list # 인스턴스 생성 시 사용할 secure-group 확인
$ nova boot --flavor m1.tiny --image “Ubuntu_14.04_LTS” --nic net-id=466d5fa4-435f-446a-9e9b-
ee756ec23b7a --securerity-group default --key-name test-key test-instance1
$ nova list # 확인
$ nova get-vnc-console test-instance1 novnc # novnc URL 확인
11. Create Windows Instance
• Glance에서는 .img파일을 사용
• iso파일을 .img파일로 만들어줘야 함
[Create .img File]
- 버전 : ko_windows_7_professional_k_x64.iso
- Controller node에서 작업
- .img파일을 만들기 위해 virt-manager라는 레드햇의 프리웨어 사용
1. Xwindow 환경 설치
2. FTP 설치
$ apt-get install –y vsftpd
$ sudo vi /etc/vsftpd.conf
-----------------------------------------
local_enable=YES
write_enable=YES
-----------------------------------------
3. 내 local에서 xftp로 ko_windows_7_professional_k_x64.iso파일 복사
4. Controller node 해상도 키우기(VrtualBox 상 이라면..)
5. CPU 가상화 지원 확인
$ egrep –c ‘(vmx|svm)’ /proc/cpuinfo
: 0 지원안함, 1이상 지원함
6. $ uname –m : 운영체제 bit 확인
12. Create Windows Instance
7. Kvm 패키지 다운
$ sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils
8. kvm, livbirtd를 사용할 user와 group 추가
$ sudo adduser ‘user’ kvm
$ sudo adduser ‘user’ libvirtd
9. $ sudo reboot now
10. 확인
$ groups user sudo kvm libvirtd
$ sudo virsh –c qemu:///system list
11. $ sudo apt-get install virt-manager
12. 드라이버 패키지 다운로드
http://alt.fedoraproject.org/pub/alt/virtio-win/lastest/images/bin > virtio-win-0.1-81.iso
13. Virtual machine manager 실행
$ virt-manager
13. Create Windows Instance
7. Kvm 패키지 다운
$ sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils
14. Image 파일 만들기
- 새로만들기 -> local install media -> Forward
- use iso image -> os type설정 -> version설정-> Forward
- choose memory and CPU settings : 2048 / 2 -> Forward
- enabled storage for this virtual machine, 20GB (최소 설치에 필요한 용량이 13GB임!!) -> Forward
- check!! Customize configuration before install
- advanced options 확인 > Finish
- 기존 Disk1 제거
- NIC -> Device model : virtio
- add Hardware -> device type : virtio disk -> storage format : raw -> finish
- add hardware -> select managed or other existing storage에서 virtio-win-0.1-81.iso 선택 ->
device type : IDE cdrom
- add hardware -> select managed or other exisiting storage에서 window7.iso 선택
-> device type : IDE cdrom
- Boot options -> Enable boot menu 선택 -> CDROM 선택
- Begin installation
15. Windows 설치,
- 설치할 위치 : 드라이버로드 > CDROMWIN7AMD64 > RedHat VirtIO SCSI 선택 후 계속 진행
16. 설치 완료 후 장치관리자 > 네트워크 어댑터에 CDROMWIN7AMD64에 네트워크 드라이버 설치
14. Create Windows Instance
17. 생성된 이미지 glance에 올리기
$ cd /var/lib/libvirt/images
$ cp windows7.img /home/user
$ glance image-create –name=“Windows7” –public –container-format bare –disk-format raw –
progress < ~/windows7.img
18. Dashboard에서 확인
19. 이미지파일로 인스턴스 생성
20. Security group에서 3389포트(RDP) 열기
21. 방화벽 사용 안함, 원격 설정 확인 , mstsc 원격 가능
15. Create Windows Instance
[Troble Shooting]
1. 인스턴스가 openstack의 dhcp서비스를 받지 못함
- ipconfig –all로 확인해보니, dhcp서버의 값이 이상함
- ipconfig에서 ip가 169.254/16(zero-config)였음
네트워크 인터페이스 초기화
: cmd > netsh –c “interface ipv4” > reset > 재부팅
2. Ping은 되지만 인터넷 브라우저에서 인터넷 접속이 안됨
- mtu설정값 변경
$ netsh interface ipv4 show interfaces (인터페이스의 색인번호 및 mtu값 등을 확인)
$ ping –f –l 1400 www.google.com (mtu값을 바꿔가며 nice한 mtu값 찾기)
$ netsh interface ipv4 set subinterface “11” mtu=1400 (여기서 11은 색인번호)
(netsh interface ipv4 set subinterface “로컬 영역 연결” mtu=1400 이름으로도 설정 가능)