vsphere ha 虚拟机监控错误_学会这3招,分分钟迁移业务繁忙虚拟机!
生活随笔
收集整理的這篇文章主要介紹了
vsphere ha 虚拟机监控错误_学会这3招,分分钟迁移业务繁忙虚拟机!
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Writer:Cgm醉里挑燈寫bug;
熱愛旅游和美食。
一、背 景遷移一臺內存密集型實例時,由于寫內存的速度較快,臟頁產生的速度一直比遷移虛擬機機,源目的虛擬機同步內存速度快,導致遷移一直完不成,結果超出了keystone token默認的1小時超時時間,最后導致虛擬機狀態錯誤,遷移完不成。二、遷移超時導致token超時1、原 因??
keystone token默認超時時間為1小時。虛擬機默認熱遷移超時取消遷移時間為(非塊遷移):虛擬機內存GB * 默認800s得出以下關系:因此,當虛擬機的規格大于4GB時,且一直無法完成遷移,持續超過keystone的1小時時間,這時會發生虛擬機變成錯誤狀態。而虛擬機規格大于4GB是常見的情況,因此需要避免虛擬機因熱遷移時間超過keystone超時時間(默認的1小時),虛擬機狀態異常錯誤。值得說明的是,多數情況下虛擬機熱遷移時間在大約10分鐘以內(虛擬機64G/1Gb網卡)。因此,如遷移大于10分鐘還未遷移完成,建議取消遷移,選擇虛擬機io空閑時段再次遷移。2、避免虛擬機遷移token超時?
增加遷移最大超時時間
1、差異傳輸xbzrle功能?
- 功能說明
- 開啟xbzrle功能方法
2、自動降頻功能?
- 功能說明
- 測試數據
- 使用
- 遷移完不成時打開
- 提前開啟
3、功能使用對比及建議?
本次測試虛擬機規格為8核16G(同監控云虛擬機規格,監控云虛擬機遷移為問題頻發事例)。該虛擬機無負載時,熱遷移耗時5s.
循環寫內存程序test.
| 開啟的功能\指標項 | 耗時(s) | cpu阻塞率 |
| 都不開啟 | 無法完成 | 無阻塞 |
| xbzrle | 5 | 無阻塞 |
| auto-converge | 20 | 阻塞90%(阻塞時間約1s) |
| xbzrle +auto-converge | 5 | 無阻塞 |
- stress malloc申請新內存壓力測試
| 開啟的功能\指標項 | 耗時(s) | cpu阻塞率 |
| 都不開啟 | 無法完成 | 無阻塞 |
| xbzrle | 無法完成 | 無阻塞 |
| auto-converge | 305 | 阻塞99%(阻塞時間約2s) |
| xbzrle +auto-converge | 300 | 阻塞99%(阻塞時間約2s) |
1、避免虛擬機遷移token超時?
修改nova代碼,設置虛擬機熱遷移最大的超時時間小于1小時(keystone默認token超時時間為1小時)。代碼位置:/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py_live_migration_monitor函數中:@@ -7558,12 +7559,15 @@ class LibvirtDriver(driver.ComputeDriver): progress_timeout = CONF.libvirt.live_migration_progress_timeout completion_timeout = int( CONF.libvirt.live_migration_completion_timeout * data_gb)+ completion_timeout = min(completion_timeout, 3400) if libvirt_migrate.should_abort(instance, now, progress_time, progress_timeout, elapsed, completion_timeout, migration.status): try: guest.abort_job()+ LOG.warning("Abort migration because of completion timeout(%ss)",+ completion_timeout) except libvirt.libvirtError as e: LOG.warning("Failed to abort migration %s", e, instance=instance)重啟nova-compute服務生效,systemctlrestart openstack-nova-compute2、打開xbzrle差異傳輸功能?
代碼位置:nova/virt/libvirt/driver.pyb/nova/virt/libvirt/driver.pydiff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.pyindex a3feb6b..1b47f1e 100644--- a/nova/virt/libvirt/driver.py+++ b/nova/virt/libvirt/driver.py@@ -7295,6 +7295,7 @@ class LibvirtDriver(driver.ComputeDriver): else: migration_flags = self._live_migration_flags+ migration_flags |= 1 << 11 serial_listen_addr = libvirt_migrate.serial_listen_addr( migrate_data) if not serial_listen_addr:重啟nova-compute服務生效,systemctlrestart openstack-nova-compute建議把xbzrle功能默認打開。3、自動降頻功能?
開啟該功能后,nova(Libvirt)檢測到遷移不太可能完成(虛擬機的寫內存速度大于遷移數據速度),并減慢了其CPU的速度,直到內存復制過程比實例的內存寫入快,提高遷移成功率。因此,開啟該功能前,請確認用戶虛擬機應用能接受CPU被阻塞。不建議把自動降頻功能默認打開。開啟步驟:A.若在遷移過程中,則先取消遷移過程1)找到遷移虛擬機的uuid(用instance_id代表)2)找到遷移id:novaserver-migration-list instance_id.用migration_id代表遷移id。3)執行取消遷移命令:novalive-migration-abort instance_idmigration_idB.打開自動降頻功能在/etc/nova/nova.conf的[libvirt]屬性下,添加live_migration_permit_auto_converge=true并重啟nova-compute服務:systemctl restartopenstack-nova-computeC.執行遷移D.遷移成功之后關閉自動降頻功能在/etc/nova/nova.conf的[libvirt]屬性下,刪除live_migration_permit_auto_converge=true并重啟nova-compute服務:systemctl restartopenstack-nova-compute附-虛擬機遷移信息查看命令1、查看遷移時的速度等信息?virsh domjobinfo virsh-list-id例如:[root@openstack-con03 ~]#virsh domjobinfo 323Job type:???????? Unbounded??Operation:??????? Outgoing migrationTime elapsed:???? 139135?????? msData processed:?? 15.146 GiBData remaining:?? 6.812 MiBData total:?????? 4.016 GiBMemory processed: 15.146GiBMemory remaining: 6.812 MiBMemory total:???? 4.016 GiBMemory bandwidth: 107.902MiB/sDirty rate:?????? 34398??????? pages/sIteration:??????? 2247???????Constant pages:?? 950532?????Normal pages:???? 3960697????Normal data:? ????15.109 GiBExpected downtime:1240???????? msSetup time:?????? 50?????????? ms注:virsh-list-id是virsh list中虛擬機的id/name(下同)。2、查看虛擬機的遷移特性信息?virsh qemu-monitor-command virsh-list-id --hmp infomigrate_capabilities3、查看虛擬機遷移的down機時間限制/cpu初始降頻信息等?virsh qemu-monitor-command virsh-list-id --hmp info migrate_parameters4、virsh取消遷移?virsh qemu-monitor-command virsh-list-id --hmp migrate_cancel●Ceph RGW整體結構,最全干貨在這!●還在為容器時區困擾?送你一劑良藥!●玩轉K8S AdmissionWebhook· END ·?記得文末點個在看鴨~點就完事兒了!
總結
以上是生活随笔為你收集整理的vsphere ha 虚拟机监控错误_学会这3招,分分钟迁移业务繁忙虚拟机!的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: list contains方法_Java
- 下一篇: 翻牌游戏如何打乱牌面java_剑仙登上虎