您好,登錄后才能下訂單哦!
這篇文章主要介紹了kilo版openstack如何調整云主機大小,具有一定借鑒價值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。
kilo版本,dashboard頁面在線調整云主機大小,點擊后無變化,需要修改配置。
所有節點修改nova配置文件/etc/nova/nova.conf
# vi /etc/nova/nova.conf [DEFAULT] ... scheduler_default_filters=RetryFilter,AvailabilityZoneFilter,RamFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter allow_resize_to_same_host=true
控制節點
# systemctl restart openstack-nova-api openstack-nova-cert openstack-nova-compute openstack-nova-scheduler openstack-nova-conductor
計算節點
# systemctl restart openstack-nova-compute
按照官方文檔安裝的kilo版本openstack的nova用戶并不是自己手動創建的,需要修改nova用戶的配置才可以配置互信
配置互信是為了避免出現調整云主機大小時出現以下類似報錯
2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher Traceback (most recent call last): 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 142, in _dispatch_and_reply 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher executor_callback)) 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 186, in _dispatch 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher executor_callback) 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 130, in _do_dispatch 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher result = func(ctxt, **new_args) 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 6890, in resize_instance 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher clean_shutdown=clean_shutdown) 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/nova/exception.py", line 88, in wrapped 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher payload) 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 85, in __exit__ 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher six.reraise(self.type_, self.value, self.tb) 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/nova/exception.py", line 71, in wrapped 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher return f(self, context, *args, **kw) 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 333, in decorated_function 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher LOG.warning(msg, e, instance_uuid=instance_uuid) 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 85, in __exit__ 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher six.reraise(self.type_, self.value, self.tb) 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 304, in decorated_function 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher return function(self, context, *args, **kwargs) 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 383, in decorated_function 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher return function(self, context, *args, **kwargs) 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 292, in decorated_function 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher migration.instance_uuid, exc_info=True) 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 85, in __exit__ 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher six.reraise(self.type_, self.value, self.tb) 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 269, in decorated_function 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher return function(self, context, *args, **kwargs) 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 361, in decorated_function 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher kwargs['instance'], e, sys.exc_info()) 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 85, in __exit__ 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher six.reraise(self.type_, self.value, self.tb) 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 349, in decorated_function 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher return function(self, context, *args, **kwargs) 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 4078, in resize_instance 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher self.instance_events.clear_events_for_instance(instance) 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib64/python2.7/contextlib.py", line 35, in __exit__ 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher self.gen.throw(type, value, traceback) 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 6479, in _error_out_instance_on_exception 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher raise error.inner_exception 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher ResizeError: Resize error: not able to execute ssh command: Unexpected error while running command. 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher Command: ssh 192.168.8.218 mkdir -p /var/lib/nova/instances/2907c778-3e30-4012-ab2c-ab43dcca1ea0 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher Exit code: 255 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher Stdout: u'' 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher Stderr: u'Host key verification failed.\r\n' 2016-07-29 14:03:13.933 33877 TRACE oslo_messaging.rpc.dispatcher
# passwd nova Changing password for user nova. New password: BAD PASSWORD: The password is shorter than 8 characters Retype new password: passwd: all authentication tokens updated successfully.
# vi /etc/passwd 將 nova:x:162:162:OpenStack Nova Daemons:/var/lib/nova:/sbin/nologin 修改為 nova:x:162:162:OpenStack Nova Daemons:/var/lib/nova:/bin/bash
此時可以切換至nova用戶,bdc217上操作
nova之間不僅僅是要無密碼,還必須得是不需要驗證,節點少的情況下所以最好手動節點之間互相先ssh連接一下。
-bash-4.2$ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/var/lib/nova/.ssh/id_rsa): Created directory '/var/lib/nova/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /var/lib/nova/.ssh/id_rsa. Your public key has been saved in /var/lib/nova/.ssh/id_rsa.pub. The key fingerprint is: 35:b2:62:61:cb:1e:fb:a9:03:19:5b:a8:38:e7:70:54 nova@bdc212 The key's randomart image is: +--[ RSA 2048]----+ | | | E | | . .o .. o | | . oo.o + . | | o . =* S | |+ + +o + | | * .o | | . .. . | | .oo | +-----------------+ -bash-4.2$ ssh-copy-id localhost -bash-4.2$ scp -r .ssh/ bdc218:~/ -bash-4.2$ scp -r .ssh/ bdc216:~/ -bash-4.2$ ssh bdc218 Last login: Fri Jul 29 16:13:20 2016 from 192.168.13.217 -bash-4.2$ uname -n bdc218
成功無密碼連接到bdc218的nova用戶
OpenStack的云主機配置類型的修改,其實相當于做了一個云主機在不同宿主機的遷移,所以需要在相關遷移云主機進行無密碼訪問,由于OpenStack是由Nova組件來管理云主機,所以需要對Nova用戶進行無密碼訪問。
但是,云主機之間的遷移可以通過virsh 的qemu+tcp的方式進行遷移,不用配置nova的互信也可以進行。
kilo版openstack云主機動態熱遷移
1、 在遷移或者調整云主機大小的過程中,虛擬機會有 downtime,運行的服務也會down掉,所以最好事先關閉正在運行的服務。
2、nova之間不僅僅是要無密碼,還必須得是不需要驗證,節點少的情況下所以最好手動節點之間互相先ssh連接一下。
感謝你能夠認真閱讀完這篇文章,希望小編分享的“kilo版openstack如何調整云主機大小”這篇文章對大家有幫助,同時也希望大家多多支持億速云,關注億速云行業資訊頻道,更多相關知識等著你來學習!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。