201118738 六、發明說明: 【發明所屬之技術領域】 特別疋有關於—種保持虛擬機器 一種虛擬機器的管理方法 的遠端操作不中斷的方法。 【先前技術】 隨著積體電職展,縣的讓中鍵理單元的運管能力 的提高。因此單一台伺服器可以同時運行多台虛擬機器 祕ηφ藉以提供給每-使用者獨立的運作環境。每—台虛擬機 盗可以視為各自獨立的t博機。在虛擬機器中亦具有記憶體、儲 存空間、運算能力與晴連结魏.,所以在虛擬機器中可以運行 獨自的作«統.,也可赠過虛擬機器連接網際網路。 因此,為了能降低計算機硬體成柄騎,已經有許多公司 在單-舰||上運行多台虛擬機||的方錢供給各種不同需求的 運作環境給員工進行工作一般而言,為能確保每—個虛擬機器 的運作能力,所以會限定單—値器中所運行虛擬機器的數量。 當飼服器所能分享.的運算能力下降時,則需將部分虛擬機器搬遷 至另一伺服器中運行。 清參考「第1圖」所示,其係為習知虛擬機器遷移示意圖。 由於將虛擬機器110搬移時,在不同伺服器上的虛擬機器11〇的 媒體存取控制位址(MediaAccess Control address,簡稱mac )會保 持不變β 201118738 但是不關服n連制交換機時會被分配料_通訊璋 ㈣)°而且在交換器中具有一個MAC表(MAC TabIe),祖〇表 用來表不麵MAC和交換n騎鱗的對應_。換言之,就是 從哪個通鱗接㈣包,封㈣來源祖〇和該通鱗就會建立一 種對應_。交換H就是根_對制絲進行封包的轉發,對 新接收到的封包,如果封包中的目標說在政表裏有通訊槔 對應,則只將該封包轉發給對應通鱗。如果沒有,才廣播 有通訊埠。但這個映射關係並不是—直存在的。#該通鱗一段 =内都沒有再魏絲對齡源騎包,軸糊係就會 被 >胥降。 除此之外,當虛擬機 〇〇 …肌站项秒主新伺服器時, 虛擬機ϋ 110並不會得知提供服務的機器已經異動。因此,。 機器no會透過新錬器連接至交換器。這時候,新伺服^交 換益上所佔用的通訊轉與¥舰器所 ==舊_。如此_來,虚___ 由於虛咖nG在㈣舰 的時間可能超過映射關係的保存時間,進懷費 射删除掉。這樣-來,虛擬機器11G需要2二_筆映 會浪費許多時間在網路連通上。'新建立映射關係,將 201118738 【發明内容】 機一操作 的方法 為達上(目的’本發崎揭露之保持虛擬機器的遠端操作不 中斷的方法包括以下步驟: 步驟a.對第_計算機的虛擬機器進行快照程式,並產生快照 副本; 步驟b.將快照副本複製至第二計算機; 步驟c.根據快照副本在第二計算機中產生新的虛擬機器,但 不啟動第二計算機中的虛擬機器; 步驟d.獲取虛擬機器的虛擬網路卡之媒體存取控制位址; 步驟e.產生相應虛擬網路卡的位址解析協定封包; 步驟f·透過第二計算機的實體網路卡廣播虛擬機器的位址解 析協定封包至交換器; 步驟g.暫停第一計算機中所運行的虛擬機器; 步驟h.在步驟a〜步騾g之間第一計算機的虛擬機器所產生的 異動複製到第二計算機的虛擬機器; , 步驟i.啟動第二計算機中所運行的虛擬機器;以及 步驟j.關閉第一計算機的虛擬機器。 本發明提供一種在虛擬機器遷移至新的實體計算機時仍能保 201118738 持操作不情賊财法,齡之就是使_顺機器的操作 不會因為θ料域的異動而受射斷。本發明録虛擬機器從 第一計算機中搬移前進行快照程式,並依據上述步驟進行搬移, $伃虛擬機$可以貫現無縫的搬移。如此—來,在虛擬機器搬移 成後卩立刻自動在父換機上重新建立了對虛擬機器網卡和交 換機通訊埠的映射_ ’無需等待舊的映射_失效後再由交換 機建立該映射_,,這鱗待_外界對虛擬機⑽ • 就會中斷了。. 有關本發明的特徵與實作,航合圖示作最佳實施例詳細說 明如下。 【實施方式】 。。本發日月可應用在具有提供虛擬機器服務的計算機(例如:飼服 :、個人電腦絲記型電轉)。為能清魏明本剌的整體架構 运請參考「第2圖」所示,其係為本發明之架構示意圖。在「第2 ’圖」中係包括交換器220、第一計算機23〇與第二計算機。第 一計算機23〇與第二計算機24〇均能運行虛擬機器训的服務。 本發明對於虛擬機器210運行的作業系統與虛擬的硬體環境並不 限定。 首先’在第一計算機230中運行虛擬機器210,並將虛擬機器 210從第-計算機230遷移到第二計算機跡接下來,請參考「第 3圖」所示,其係為本發明之運作流程示意圖。 201118738 步驟a.由第-計算機該虛擬機器進行快照程^,並產生快照 副本; 步驟b.將快照副本複製至第二計算機; 步驟c.根據快照副本在第二計算機中產生新的虛擬機器,且 不啟動第二計算機中的虛擬機器; 步驟d.獲取在第二計算機上的虛擬機器的虛擬網路卡之媒體 存取控制位址; 步驟e.產生相應虛擬網路卡的位址解析協定封包; 步驟f•透過第二計算機的實體網路卡發送虛擬機器的位址解 析協定封包至交換器 步驟g.暫停第一計算機中所運行的虛擬機器; 步驟h.在步驟a〜步驟g之間第—計算機的虛擬機騎產生的 異動複製到第二計算機的虛擬機器; 步驟i.啟動第二計算機中所運行的虛擬機器;以及 步驟j.關閉第一計算機的虛擬機器。 為能清楚說明本發明運作流程,還請同時配合「第4A圖」、 〜「第4D圖」所示。在第一計算機23〇上對虛擬機器21〇進行快 照程式(snapshot) ’侠照程式係用以對虛擬機器21〇的環境資訊(例 如:虛擬的中央處理器、記憶體大小、儲存空間或相關硬體資訊) 進行備伤複製(如「第4A圖」的第二計算機240中以虛線表示的 虛擬機器210)。在完成快照程式後,第一計算機23〇會將快照資 201118738 料傳送到第二計算機240。當第二計算機240在完成虛擬機器210 的快照資料接收後,第二計算機240根據快照資料創建相同虛擬 硬體環境的虛擬機器210(對應步驟a〜步驟c)。但值得注意的是, 這時候在第二計算機240上的虛擬機器210是尚未被啟動的。 第二計鼻機240在創建虛擬機器21〇的過程中,第二電腦會 根據從第一電腦傳遞過來的虛擬機器的配置資訊創建出虛擬機器 的各種設備,包括虛擬網卡,且虛擬網卡的MAC和在第一電腦上 擊的虛擬機器210是絕對保持一致不變的,所以在本發明中在第二 計算機240創建好虛擬機器並獲取虛擬機器位址後,第二計 算機240會透過虛擬網路卡發出位址解析協定封包(Address Resolution Protocol簡稱arp) 在此一 _封包中,會將虛擬網 路卡之媒體存取控制位址寫入位址解析龄封包中的來源襴位裡 (對應步驟d〜步驟Q,但不需對繼封包的内容寫入任何資料或 隨意寫入一些不影響網路的虛假資料。 響 ㈣第二計算機240可以得知虛擬機器21〇的·c位址(虛 擬機器的MAC在不同祠服器上都簡不變,這是由虛擬機器的配 置資訊決定的)’所以可以由第二計算機24〇代替虛擬機器2ι〇發 送 封匕、、。交換盗220。而此一步驟的主要目的是要將虛擬機 器210的MAC位址廣播給交換器22〇,因此不需對聊封包的 内容作任何添加。 接著’在運行步驟a〜步驟f的期間,對於第一計算機23〇的 201118738 虛擬機器210所產生的異動進行備份,並將異動部分複製到第二 機器的虛擬機器210中。由於在此期間,第—計算機23〇的虛擬 機器210並未停止運作,因此可能會有部分異動的資料。為確保 虛擬機器210在搬移前後的資料一雌,所以在第—計算機別 的虛擬機H 210停止前,將有異動的龍複製到第二計算機㈣ 的虛擬機器210中(對應步驟g〜步驟h)。 當把異動哺料複翻第二計算機·的虛擬機後, 隨即啟動第二計算機24〇 _所運行的虛擬機器21〇。並透過第二計 算機 體網路卡發送虛擬機_ 21〇 &撕封包。在網路解 析封包中已加人虛擬機器21G的祖〇位址(換言之,虛擬機器的 MAC位址位址保持不變)。當交換器22〇接收到此一封包時,交 換器220會向各層級的網路設備進行更新資料的動作。換言之, 藉由第二計算機240發送代表虛擬機器21〇的ARP封包給交換器 220 ’藉以更新各網路設備的mac表格。最後,將第一計算機幻〇 中的虛擬機器210關閉(如「第w圖」第一計算機中以虛線表示 的虛擬機器21G)。如此-來,就可以達到無縫遷移的目的(對應步 驟i〜步驟j)。 “ 本發明提供-種在虛擬機器训遷移至新計算機時保持網路 連通的處理方法。本發明係在虛擬機器21〇從第一計算機Bo中 搬移前進行快照程式,並依據上述步驟進行搬移,使得虛擬機器 210可以無縫的搬移。如此一來’即可在搬移虛擬機器训後立即 201118738 自動在交換器220上重新建立對虛擬機器21〇的映射關係。 雖然本發似前述之較佳實施纖露如上職並非用以限 定本發明,任何熟習相像技藝者,在不脫離本發明之精神和範圍 内’ S可作歸之更動朗飾,目此本魏 本說明書所附之申請專利範圍所界定者為準。 圍舰 【圖式簡單說明】 第1圖係為習知虛擬機器遷移示意圖。 第2圖係為本發明之架構示意圖。 第3圖係為本發明之運作流程示意圖。 第4A圖係為本發明運作示意圖。 第4B圖係為本發明運作示意圖。 第4C圖係為本發明運作示意圖。 第4D圖係為本發明運作示意圖。 【主要元件符號說明】 虛擬機器110 交換器120 虛擬機器210 交換器220 第一計算機230 第二計算機240201118738 VI. Description of the invention: [Technical field to which the invention pertains] In particular, there is a method for maintaining a virtual machine, a remote machine operation of a virtual machine management method. [Prior Art] With the integration of the electric power exhibition, the county's transportation capacity of the middle key unit is improved. Therefore, a single server can simultaneously run multiple virtual machines to provide a separate operating environment for each user. Each virtual pirate can be regarded as a separate t-machine. In the virtual machine, it also has memory, storage space, computing power and clear connection Wei. Therefore, in the virtual machine, it can run its own work. It can also be used to connect virtual machines to the Internet. Therefore, in order to reduce the computer hardware to ride the handle, many companies have run multiple virtual machines on a single-ship|| to provide various operating environments for different needs. Ensuring the operational capabilities of each virtual machine will limit the number of virtual machines running in the single-single. When the computing power of the feeding device can be reduced, some virtual machines need to be moved to another server for operation. Refer to "Figure 1" for a brief description of the migration of a conventional virtual machine. When the virtual machine 110 is moved, the media access control address (mac) of the virtual machine 11 on different servers will remain unchanged. β 201118738 but will not be served when the n-connected switch is not used. Sub-ingredients _ communication 四 (four)) ° and in the switch has a MAC table (MAC TabIe), the ancestral table is used to table MAC and exchange n squad correspondence _. In other words, it is from which scaly (4) package, and the (four) source ancestor and the scaly will establish a corresponding _. The exchange H is the root _ forwarding of the packet for the silk. For the newly received packet, if the target in the packet says that there is communication 槔 in the political table, only the packet is forwarded to the corresponding scaly. If not, broadcast the communication port. But this mapping relationship is not - straightforward. #通通鳞段 = There is no Weisi on the age source riding bag, the axis paste will be > In addition, when the virtual machine 肌 ... muscle station item seconds master new server, the virtual machine ϋ 110 does not know that the machine providing the service has changed. therefore,. The machine no will connect to the switch through the new device. At this time, the communication used by the new servo ^ exchange is transferred to the ship's == old_. So _ come, virtual ___ because the virtual coffee nG in the (four) ship time may exceed the preservation time of the mapping relationship, the entrance fee is deleted. In this way, the virtual machine 11G needs 2 _ pen maps to waste a lot of time on the network connection. 'Newly established mapping relationship, 201118738 【Inventive content】 The method of operation of the machine is up to (the purpose of this method is to keep the remote operation of the virtual machine uninterrupted by the method of the present disclosure includes the following steps: Step a. For the first computer The virtual machine performs the snapshot program and generates a snapshot copy; step b. copies the snapshot copy to the second computer; step c. generates a new virtual machine in the second computer according to the snapshot copy, but does not start the virtual in the second computer Step d. Obtain a media access control address of the virtual network card of the virtual machine; Step e. Generate an address resolution protocol packet of the corresponding virtual network card; Step f· Broadcast through the physical network card of the second computer The address resolution protocol of the virtual machine is encapsulated to the switch; step g. suspending the virtual machine running in the first computer; step h. copying the transaction generated by the virtual machine of the first computer between step a and step g a virtual machine of the second computer;, step i. starting the virtual machine running in the second computer; and step j. closing the virtual of the first computer The invention provides a method for maintaining the operation of the virtual machine when the virtual machine is migrated to a new physical computer. The age of the machine is such that the operation of the machine is not interrupted by the change of the θ material field. According to the invention, the virtual machine is moved from the first computer to perform the snapshot program, and according to the above steps, the virtual machine $ can be seamlessly moved. Thus, after the virtual machine is moved, it is automatically The parent switchover has re-established the mapping of the virtual machine NIC and switch communication _ 'do not wait for the old mapping _ after the failure and then the switch establishes the mapping _, this scale waits _ outside the virtual machine (10) • will be interrupted The features and implementations of the present invention are described in detail below as a preferred embodiment. [Embodiment] The present day and month can be applied to a computer having a virtual machine service (for example: feeding clothes: For the overall structure of the company, please refer to the "Figure 2", which is a schematic diagram of the structure of the invention. In the "2' map" The system includes a switch 220, a first computer 23, and a second computer. Both the first computer 23 and the second computer 24 can run a virtual machine training service. The present invention operates on the virtual machine 210 operating system and virtual hard. The physical environment is not limited. First, the virtual machine 210 is operated in the first computer 230, and the virtual machine 210 is migrated from the first computer 230 to the second computer. Next, please refer to the "Fig. 3" A schematic diagram of the operational flow of the present invention. 201118738 Step a. Snapshot process by the virtual machine of the first computer and generate a snapshot copy; Step b. Copy the snapshot copy to the second computer; Step c. According to the snapshot copy in the second Generating a new virtual machine in the computer and not starting the virtual machine in the second computer; Step d. Obtaining a media access control address of the virtual network card of the virtual machine on the second computer; Step e. Generating the corresponding virtual The address resolution protocol packet of the network card; step f• sending the address resolution protocol packet of the virtual machine to the switch through the physical network card of the second computer Step g. suspending the virtual machine running in the first computer; step h. copying the transaction generated by the virtual machine ride of the first computer between steps a and g to the virtual machine of the second computer; step i. starting the second a virtual machine running on the computer; and step j. shutting down the virtual machine of the first computer. In order to clearly explain the operational flow of the present invention, please also cooperate with "4A" and "4D". Snapshot of the virtual machine 21 on the first computer 23〇 'The camera program is used to view the virtual machine 21 (eg virtual CPU, memory size, storage space or related) Hardware Information) A copy of the damage (such as the virtual machine 210 indicated by a broken line in the second computer 240 of "FIG. 4A"). After the snapshot program is completed, the first computer 23 transfers the snapshot data to the second computer 240. After the second computer 240 completes the snapshot data reception of the virtual machine 210, the second computer 240 creates a virtual machine 210 of the same virtual hardware environment based on the snapshot data (corresponding to steps a to c). It is worth noting, however, that the virtual machine 210 on the second computer 240 is not yet activated. In the process of creating the virtual machine 21, the second computer 240 creates various devices of the virtual machine according to the configuration information of the virtual machine transmitted from the first computer, including the virtual network card, and the MAC of the virtual network card. The virtual machine 210 hit on the first computer is absolutely consistent, so in the present invention, after the second computer 240 creates the virtual machine and obtains the virtual machine address, the second computer 240 passes through the virtual network. The address resolution protocol (ARP) is in the packet, and the media access control address of the virtual network card is written into the source location in the address resolution packet (corresponding steps) d~Step Q, but it is not necessary to write any data to the content of the subsequent packet or randomly write some false data that does not affect the network. (4) The second computer 240 can know the address of the virtual machine 21 (virtual) The MAC of the machine is not changed on different servers, which is determined by the configuration information of the virtual machine. ' So it can be sent by the second computer 24〇 instead of the virtual machine 2〇匕, ,. Exchange thief 220. The main purpose of this step is to broadcast the MAC address of the virtual machine 210 to the switch 22, so there is no need to add any content of the chat packet. Then 'run step a During the period of step f, the transaction generated by the 201118738 virtual machine 210 of the first computer 23〇 is backed up, and the transaction portion is copied to the virtual machine 210 of the second machine. Since during this period, the first computer 23 The virtual machine 210 does not stop working, so there may be some changed data. In order to ensure that the virtual machine 210 has a female before and after the moving, the dragon will be copied before the other computer H 210 stops. Go to the virtual machine 210 of the second computer (4) (corresponding to step g to step h). After the transaction feed is overturned to the virtual machine of the second computer, the virtual machine 21 running on the second computer 24〇 is started. And send the virtual machine _ 21 〇 & tear through the second computer body network card. The virtual machine 21G ancestor address has been added to the network parsing packet (in other words, the virtual machine The MAC address of the MAC address remains unchanged. When the switch 22 receives the packet, the switch 220 performs an action of updating the data to the network devices of each level. In other words, the representative is sent by the second computer 240. The virtual machine 21A's ARP packet is sent to the switch 220' to update the mac table of each network device. Finally, the virtual machine 210 in the first computer magic is turned off (as in the "wth picture", the first computer is indicated by a dotted line. Virtual machine 21G). So, the goal of seamless migration can be achieved (corresponding to steps i to j). The present invention provides a method for maintaining network connectivity when a virtual machine is migrated to a new computer. The present invention performs a snapshot program before the virtual machine 21 moves from the first computer Bo, and moves according to the above steps, so that the virtual machine 210 can be moved seamlessly. In this way, the mapping relationship to the virtual machine 21〇 can be automatically re-established on the switch 220 immediately after the virtual machine training is moved. Although the present invention is not intended to limit the present invention, any skilled person can make a change in the spirit and scope of the present invention. The scope of the patent application attached to this specification shall prevail. The siege [simplified description of the diagram] The first diagram is a schematic diagram of the migration of the conventional virtual machine. Figure 2 is a schematic diagram of the architecture of the present invention. Figure 3 is a schematic diagram of the operational flow of the present invention. Figure 4A is a schematic diagram of the operation of the present invention. Figure 4B is a schematic diagram of the operation of the present invention. Figure 4C is a schematic diagram of the operation of the present invention. Figure 4D is a schematic diagram of the operation of the present invention. [Main Component Symbol Description] Virtual Machine 110 Switch 120 Virtual Machine 210 Switch 220 First Computer 230 Second Computer 240