rhev_3.x_upgrade

RHEV 3.x Upgrade

이강우 2017/02/12 19:56

문서 작성중…………


192.168.0.180	rhevm.local.domain	rhevm
192.168.0.190	nas.local.domain	nas

192.168.0.181	host1.local.domain	host1
192.168.0.182	host2.local.domain	host2
192.168.0.183	host3.local.domain	host3
192.168.0.184	host4.local.domain	host4
192.168.0.185	host5.local.domain	host5


[rhel6]
name=rhel6
baseurl=http://192.168.0.156/repo/rhel6/
enabled=1
gpgcheck=0

[rhev3.5]
name=rhev3.5
baseurl=http://192.168.0.156/repo/rhev3.5/
enabled=1
gpgcheck=0


## RHEL 7 Hypervisor용
[rhev3.6host]
name=rhev3.6host
baseurl=http://192.168.0.156/repo/rhev3.6host/
enabled=1
gpgcheck=0

## RHEL 6 Manager용
[rhev3.6manager]
name=rhev3.6manager
baseurl=http://192.168.0.156/repo/rhev3.6manager/
enabled=1
gpgcheck=0

chkconfig ntpdate on
chkconfig ntpd on
chkconfig cpuspeed off
chkconfig cups off


yum -y update
yum -y install vim unzip


### 1 ### RHEV-M Storage Domain 외부 변경 작업
1. 9번 Host를 임시 외부 NAS 서버로 셋팅 (RHEL7 기반으로 구성 나중에 Selfhost로 이용하기 위함)
2. 현재 구성된 RHEV-M NFS 영역을 9번 NAS로 이전 및 기동 테스트

	- Global Maintenance mode set
	- Manager Shutdown
	[root@host1 ~]# hosted-engine --vm-shutdown
	[root@host1 ~]# service ovirt-ha-broker stop
	Stopping ovirt-ha-broker:                                  [  OK  ]
	[root@host1 ~]# service ovirt-ha-agent stop
	Stopping ovirt-ha-agent:                                   [  OK  ] -> 시간이 매우 오래 걸림

	외부 NAS 영역을 host에 임시로 마운트
	[root@host1 /]# mount nas:/data/nfs/3.5rhevm /mnt/

	vdsm 권한으로 host내의 NFS영역내 데이터를 마운트 위치로 복제
	[root@host1 ~]# su -s /bin/bash vdsm
	bash-4.1$ cd /nfs
	bash-4.1$ ls -al
	total 12
	drwxr-xr-x.  3 vdsm kvm  4096 Feb 11 15:14 .
	dr-xr-xr-x. 27 root root 4096 Feb 11 19:33 ..
	drwxr-xr-x.  6 vdsm kvm  4096 Feb 11 15:15 1a2ccd20-8884-489c-9732-d4b3a115341a
	-rwxr-xr-x.  1 vdsm kvm     0 Feb 11 19:56 __DIRECT_IO_TEST__
	bash-4.1$ cp -rp * /mnt/

	복제 완료후 외부 NAS영역 umount

	현재 hosted-engine에서 참조하는 rhevm storage domain경로 변경
	[root@host1 ~]# vim /etc/ovirt-hosted-engine/hosted-engine.conf
	...
	storage=192.168.0.181:/nfs	<- 이부분을 외부 NAS경로로 변경하여 준다.
	...

	추후 self host를 추가하기 위한 answers.conf 파일도 수정한다.
	[root@host1 ~]# vim /etc/ovirt-hosted-engine/answers.conf
	...
	OVEHOSTED_STORAGE/storageDomainConnection=str:192.168.0.181:/nfs	<- 이부분을 외부 NAS경로로 변경하여 준다.
	...

	host reboot

	hosted-engine --vm-status 상태값이 확인될때까지 대기 후 --vm-start 진행


### 2 ### Self-Host 추가
1. 7, 8번 서버를 이용하여 self-host 2, 3 추가 (rhev-hypervisor7-7.2-20160219.0.el6ev image 사용)
	Hypervisor 설치 후
	- IP Address 설정
	- SSH 접근 설정
	- /etc/hosts 등록
	- Additional self host 등록
	- Web UI에서 Maintenance mode로 변경후 새로운 7 Cluster를 생성하여 그곳에 할당
	- Hypervisor에서 Retry 클릭


2. 7, 8번 호스트 Maintenance mode 변경

3. 추가된 7, 8번 SelfHost를 최신으로 업그레이드
	Manager VM에서 아래 패키지 추가 설치
	# subscription-manager repos --enable rhel-6-server-rhevh-rpms
	# yum install rhev-hypervisor7 
	패키지 설치 하고 나면 WebUI에서 해당 하이퍼바이저 업그레이드 가능해짐
	업그레이드 후 인식되기까지 5~10분 소요됨

4. 7, 8번 호스트 업그레이드 후 Active되면 다시 Maintenance mode로 변경
5. 변경후 콘솔에서 F2를 눌러 CLI모드에서 서비스 재시작
	# systemctl restart ovirt-ha-agent.service 
	# systemctl restart ovirt-ha-broker.service
6. 7, 8번 호스트 Maintenance mode 를 Active 로 전환

-> 이 단계까지 진행하면 Manager VM이 새로 추가된 7, 8번 호스트로 이전 가능해짐
-> 이전 실패시
	host1에서 hosted-engine --vm-shutdown 으로 manager shutdown 수행
	shutdown이 완전히 된것을 확인후
	host2에서 --vm-start

### 3 ### 나머지 호스트 RHEL 7 기반으로 업그레이드
	여기서부터는 그냥 RHEL 7 설치후 rhev3.6host 레포지토리만으로 self-host 등록하면 됨
	하나씩 비워서 삭제하면서 진행


### 4 ### Manager 3.6 upgrade
	모든 호스트가 RHEL7기반으로 변경된 이후에 RHEV-M 3.5를 3.6으로 업그레이드 가능해짐
	- rhel-x86_64-server-6-rhevm-3.5 리포지토리는 제거
	- rhel-x86_64-server-6-rhevm-3.6 리포지토리 설정
	- # yum update rhevm-setup
	- # engine-setup







-------------------------- Physical Manager 전환

1. Global Maintenance mode 설정
2. SPM을 hosted-engine 이 아닌 다른 hypervisor로 변경
3. manager backup
4. hosted-engine --vm-shutdown
service ovirt-ha-agent stop
service ovirt-ha-broker stop
5. 신규 Manager host 구성 OS설치 및 IP 설정(RHEVM IP)
6. 신규 RHEVM 설치
7. engine-cleanup 후 백업데이터 복구
8. 기동 확인
9. 기존 hosted-engine 제거
10. 기존 hosted-engine vm 제거
[root@rhevm ~]# su - postgres -c psql
psql (8.4.20)
Type "help" for help.

postgres=# \c engine
psql (8.4.20)
You are now connected to database "engine".
engine=# select vm_guid from vm_static where vm_name like 'HostedEngine';
               vm_guid                
--------------------------------------
 97ca9740-d352-4e28-8c4a-6919b810cfee
(1 row)

engine=# select snapshot_id from snapshots where vm_id='97ca9740-d352-4e28-8c4a-6919b810cfee';
             snapshot_id              
--------------------------------------
 5884c3a5-73dd-4778-8267-af005c1e5446
(1 row)

engine=# delete from snapshots where snapshot_id='5884c3a5-73dd-4778-8267-af005c1e5446';
DELETE 1
engine=# delete from vm_static where vm_guid='97ca9740-d352-4e28-8c4a-6919b810cfee';
DELETE 1
engine=# 


--- 3.6 upgrade
1. repository 변경 rhev3.6manager
2. yum update rhevm-setup
3. engine-setup

--- Hypervisor Upgrade
1. Maintenance mode 로 변경후 제거하고 RHEL 7으로 신규 설치
2. 재등록

------------------ 여기까지 3.6 업그레이드




-- Physical Manager to Selfhosted engine migration
1. Physical Manager backup and disable
	- service ovirt-engine stop
	- chkconfig ovirt-engine off
	- engine-backup --mode=backup....
	- backup file copy
	- server shutdown

2. Selfhost RHEL7 설치 및 준비
	- RHEL7 설치
	- rhev3.6host 리포 등록
	- update
	- install ovirt-hosted-engine-setup
	- Manager 설치용 RHEL6 ISO 업로드

3. selfhost engine 설치
	- NetworkManager disable
	- systemctl stop NetworkManager
	- systemctl disable NetworkManager
	- systemctl mask NetworkManager
	- chkconfig network on
	- service network restart

	- hosted-engine --deploy
	- 이 단계를 진행하기 전 물리 Manager Server가 중지되어있어야 한다.
	- 또한 새로 설치되는 3.6 Selfhost는 브릿지 이름이 rhevm이 아니라 ovirtmgmt로 되어있다.
	  만약 업그레이드 한 시스템이라면 기존 rhevm네트워크 이름과 달라서 마지막에 설치가 실패하게 되는데
	  이걸 해결하기 위하 아래와 같이 answer파일을 미리 만들어놓자
	  
	  -------- rhevm_network.conf
	  [environment:default]
	  OVEHOSTED_NETWORK/bridgeName=str:rhevm

	- 이제 아래 명령어로 디플로이를 시작한다.
	- hosted-engine --deploy --config-append=rhevm_network.conf

4. RHEV-M 설치 - 여기서부터는 rhev-m vm에서 진행
	- 백업받은 3.6 manager 백업파일 업로드
	- rhev3.6manager repository 설정
	- yum update
	- yum install rhevm
	- yum install postgresql-server

	# 여기부터 수동으로 복구하여야 한다. engine-setup은 나중에 진행한다.
	# 백업데이타 복구를 위한 DB설정
	[root@rhevm ~]# service postgresql initdb
	Initializing database:                                     [  OK  ]
	[root@rhevm ~]# service postgresql start
	Starting postgresql service:                               [  OK  ]
	[root@rhevm ~]# chkconfig postgresql on
	
	# DB 계정 생성 - report와 history는 필요시 생성
	[root@rhevm ~]# su - postgres -c psql
	psql (8.4.20)
	Type "help" for help.

	postgres=# create role engine with login encrypted password 'redhat';
	CREATE ROLE
	postgres=# create role ovirt_engine_reports with login encrypted password 'redhat';
	CREATE ROLE
	postgres=# create role ovirt_engine_history with login encrypted password 'redhat';
	CREATE ROLE

	## DB 생성 - report와 history는 필요시 생성
	postgres=# create database engine owner engine template template0 encoding 'UTF8' lc_collate 'en_US.UTF-8' lc_ctype 'en_US.UTF-8';
	CREATE DATABASE
	postgres=# create database ovirt_engine_reports owner ovirt_engine_reports template template0 encoding 'UTF8' lc_collate 'en_US.UTF-8' lc_ctype 'en_US.UTF-8';
	CREATE DATABASE
	postgres=# create database ovirt_engine_history owner ovirt_engine_history template template0 encoding 'UTF8' lc_collate 'en_US.UTF-8' lc_ctype 'en_US.UTF-8';
	CREATE DATABASE
	postgres=# \q

	- DB 접근 설정 - 기존에 설정되어있는부분은 주석처리하고 아래 두줄만 추가한다.
	[root@rhevm ~]# vim /var/lib/pgsql/data/pg_hba.conf
	host    all         all         0.0.0.0/0             md5
	host    all         all         ::0/0                 md5

postgresql 최대 접속 수를 늘려줘야 한다.
[root@rhevm ~]# vim /var/lib/pgsql/data/postgresql.conf
max_connections = 200 # 기본값이 100으로 되어있는것을 150 이상으로 늘려준다.


[root@rhevm ~]# service postgresql restart
Stopping postgresql service:                               [  OK  ]
Starting postgresql service:                               [  OK  ]

[root@rhevm ~]# engine-backup --mode=restore --scope=all --file=rhev3.6.backup --log=restore.log --change-db-credentials --db-host=localhost --db-name=engine --db-user=engine --db-password --restore-permissions
Enter Engine database password: 
Preparing to restore:
- Setting credentials for Engine database 'engine'
- Unpacking file 'rhev3.6.backup'
Restoring:
- Files
- Engine database 'engine'
  - Cleaning up temporary tables in engine database 'engine'
Rewriting /etc/ovirt-engine/engine.conf.d/10-setup-database.conf
You should now run engine-setup.
Done.
[root@rhevm ~]# 

# 복구가 완료되었다.
- engine-setup 진행

5. 여기서부터 다시 Host로 돌아와서 나머지 진행한다.
selfhost에서 아래 상태에서 대기중이었을텐데 엔터를 치면 다음으로 진행된다.

          Make a selection from the options below:
          (1) Continue setup - oVirt-Engine installation is ready and ovirt-engine service is up
          (2) Abort setup
          (3) Power off and restart the VM
          (4) Destroy VM and abort setup
         
          (1, 2, 3, 4)[1]: 
         
          Checking for oVirt-Engine status at rhevm.local.domain...
[ INFO  ] Engine replied: DB Up!Welcome to Health Status!
[ INFO  ] Acquiring internal CA cert from the engine
[ INFO  ] The following CA certificate is going to be used, please immediately interrupt if not correct:
[ INFO  ] Issuer: C=US, O=local.domain, CN=rhevm.local.domain.43526, Subject: C=US, O=local.domain, CN=rhevm.local.domain.43526, Fingerprint (SHA-1): A8EAB4492391075F7DB9E2BC18C02288C80F5308
[ INFO  ] Connecting to the Engine

이부분에서 Cluster 포함시키는데 오류가 발생한다면 위에서 말한 rhevm네트워크와 ovirtmgmt 충돌때문이다.
https://access.redhat.com/solutions/2292861
기존 management network는 rhevm인데 신규 설치되는 selfhost는 ovirtmgmt 논리 네트워크를 가지고있어 클러스터에 등록이 되지 않는다.

최종적으로 Cluster에 Selfhost를 포함시키는데 비어있는 클러스터를 선택하도록 한다.
또는 Ignore 선택후 Selfhost 구성작업이 완료되면 호스트를 일단 reboot
부팅후 hosted-engine --vm-status로 상태 확인후
hosted-engine --vm-start 로 Manager VM 기동


정상인경우 아래와같이 나옴
------------------------------------------
          Make a selection from the options below:
          (1) Continue setup - oVirt-Engine installation is ready and ovirt-engine service is up
          (2) Abort setup
          (3) Power off and restart the VM
          (4) Destroy VM and abort setup
         
          (1, 2, 3, 4)[1]: 
         
          Checking for oVirt-Engine status at rhevm.local.domain...
[ INFO  ] Engine replied: DB Up!Welcome to Health Status!
[ INFO  ] Acquiring internal CA cert from the engine
[ INFO  ] The following CA certificate is going to be used, please immediately interrupt if not correct:
[ INFO  ] Issuer: C=US, O=local.domain, CN=rhevm.local.domain.43526, Subject: C=US, O=local.domain, CN=rhevm.local.domain.43526, Fingerprint (SHA-1): A8EAB4492391075F7DB9E2BC18C02288C80F5308
[ INFO  ] Connecting to the Engine
          Enter the name of the cluster to which you want to add the host (ClusterA, Default) [Default]: 
[ INFO  ] Waiting for the host to become operational in the engine. This may take several minutes...
[ INFO  ] Still waiting for VDSM host to become operational...
[ INFO  ] The VDSM Host is now operational
[ INFO  ] Saving hosted-engine configuration on the shared storage domain
          Please shutdown the VM allowing the system to launch it as a monitored service.
          The system will wait until the VM is down.
[ INFO  ] Enabling and starting HA services
[ INFO  ] Stage: Clean up
[ INFO  ] Generating answer file '/var/lib/ovirt-hosted-engine-setup/answers/answers-20170212201417.conf'
[ INFO  ] Generating answer file '/etc/ovirt-hosted-engine/answers.conf'
[ INFO  ] Stage: Pre-termination
[ INFO  ] Stage: Termination
[ INFO  ] Hosted Engine successfully set up
[root@host1 ~]# 

-----------------------------------------------
----- 4.0 업그레이드

0. 3.6 RHEVM 백업 전에 모든 사항이 3.6으로 셋팅되어있는지 확인 필요(데이터센터, 클러스터, 호스트 등등등) (매우 중요!!)

1. 3.6 RHEVM backup

2. host RHEL7 재설치

3. RHV 4.0 manager 설치 (rhv4.0 repo)
	yum install rhevm

4. 3.6 백업본을 4.0에 복원
	백업에 Data Warehouse 데이터가 있는 경우 --provision-dwh-db 옵션을 사용합니다
	Install optional extension packages if they were installed on the Red Hat Enterprise Virtualization Manager 3.6 시스템에 확장 패키지 옵션이 설치되어 있었으면 새로운 버전에서도 이러한 패키지를 설치합니다.
	# yum install ovirt-engine-extension-aaa-ldap ovirt-engine-extensionaaa-misc ovirt-engine-extension-logger-log4j

	# 복원시 db password 변경은 하지 말것.
	# engine-backup --mode=restore --scope=all --file=rhevm3.6.backup --log=restore.log --provision-db --provision-dwh-db --no-restore-permissions
	# engine-setup

5. Hypervisor 4.0으로 업그레이드
	해당 호스트 maintenance mode로 변경
	rhel7 과 rhv4.0 repo 설정
	yum update

6. 클러스터를 4.0으로 설정
7. 호스트를 4.0 클러스터에 편입
8. VM 마이그레이션


로그인하면 댓글을 남길 수 있습니다.
  • rhev_3.x_upgrade.txt
  • 마지막으로 수정됨: 2017/02/14 11:19
  • 저자 koov