TWI764483B - Method of expanding available space using external space - Google Patents
Method of expanding available space using external spaceInfo
- Publication number
- TWI764483B TWI764483B TW109146575A TW109146575A TWI764483B TW I764483 B TWI764483 B TW I764483B TW 109146575 A TW109146575 A TW 109146575A TW 109146575 A TW109146575 A TW 109146575A TW I764483 B TWI764483 B TW I764483B
- Authority
- TW
- Taiwan
- Prior art keywords
- space
- disk
- time
- exhaustion
- exhaustion time
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 34
- 230000003416 augmentation Effects 0.000 claims description 2
- 238000010586 diagram Methods 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
本發明係關於一種利用外部空間的可用空間擴充方法,特別係關於一種有效地分配磁碟的儲存空間的利用外部空間的可用空間擴充方法。The present invention relates to a free space expansion method utilizing external space, in particular to a free space expansion method utilizing external space for efficiently allocating storage space of a disk.
在現行的技術中,硬體的儲存設備通常是以多個硬碟組合成一個儲存池(storage pool),並再將儲存池分割成幾個容量相等或不相等的儲存空間,以供客戶端作業系統(guest operating system,guest os)存取該些儲存空間。而若當儲存空間的空間耗盡時,則使用該儲存空間的客戶端作業系統便無法正常運作。In the current technology, the hardware storage device is usually composed of multiple hard disks into a storage pool, and then the storage pool is divided into several storage spaces with equal or unequal capacities for clients to use. The operating system (guest operating system, guest os) accesses these storage spaces. And if the space of the storage space is exhausted, the client operating system using the storage space cannot operate normally.
舉例而言,當客戶端作業系統要將某一檔案寫入其對應的儲存空間,且該檔案的大小大於該儲存空間的剩餘磁碟可用空間時,客戶端作業系統不僅無法順利將該檔案寫入其對應的儲存空間,且該儲存空間的剩餘磁碟可用空間亦會處於閒置狀態,直到該儲存空間被釋放出足夠將該檔案寫入的磁碟可用空間時,才能將該檔案寫入該儲存空間。因此,儲存空間不僅無法被有效地利用,更使得檔案排程因而受到影響。For example, when the client operating system wants to write a file into its corresponding storage space, and the size of the file is larger than the remaining free disk space of the storage space, the client operating system cannot write the file smoothly. into its corresponding storage space, and the remaining free disk space in the storage space will also be in an idle state, until the storage space is freed up enough to write the file into the disk. storage space. Therefore, not only the storage space cannot be used effectively, but also the file scheduling is affected.
鑒於上述,本發明提供一種以滿足上述需求的利用外部空間的可用空間擴充方法。In view of the above, the present invention provides an available space expansion method utilizing external space to meet the above requirements.
依據本發明一實施例的一種利用外部空間的可用空間擴充方法,包含:將一檔案容量除以一訪客寫入速度以取得一門檻時間;將一第一磁碟可用空間除以該訪客寫入速度以取得一第一磁碟空間耗盡時間;判斷該第一磁碟空間耗盡時間是否小於該門檻時間;當判斷該第一磁碟空間耗盡時間小於該門檻時間時,將一第二磁碟可用空間除以該訪客寫入速度以取得一第二磁碟空間耗盡時間;判斷該第二磁碟空間耗盡時間是否不小於該門檻時間;以及當判斷該第二磁碟空間耗盡時間不小於該門檻時間時,發出一空間共享請求至對應該第二磁碟可用空間的一作業系統,以將該檔案抄寫進該第二磁碟可用空間。A free space expansion method utilizing external space according to an embodiment of the present invention includes: dividing a file size by a guest write speed to obtain a threshold time; dividing a first disk free space by the guest write speed speed to obtain a first disk space exhaustion time; determine whether the first disk space exhaustion time is less than the threshold time; when it is determined that the first disk space exhaustion time is less than the threshold time, a second disk space exhaustion time is determined Divide the available disk space by the guest writing speed to obtain a second disk space exhaustion time; determine whether the second disk space exhaustion time is not less than the threshold time; and when determining the second disk space exhaustion time When the time limit is not less than the threshold time, a space sharing request is sent to an operating system corresponding to the available space of the second disk to copy the file into the available space of the second disk.
綜上所述,依據本發明一或多個實施例所示的利用外部空間的可用空間擴充方法,不僅可以有效地利用閒置的儲存空間,並且,藉由以磁碟空間耗盡時間判斷要將檔案存入哪個儲存空間,更可以直覺地判斷問題排除的時間,以協助檔案抄寫的排程。此外,依據本發明一或多個實施例所示的利用外部空間的可用空間擴充方法,更可以請求另一guest os分享出一部份的儲存空間以即時地完成檔案抄寫的作業,並且藉由偵測儲存空間的磁碟可用空間,可以即時地通知相關人員處理,避免因儲存空間而影響到guest os的運作。To sum up, according to the available space expansion method using external space shown in one or more embodiments of the present invention, not only can the idle storage space be effectively used, but also the disk space exhaustion time can be used to determine whether to In which storage space the file is stored, it is possible to intuitively judge the time when the problem is eliminated, so as to assist in the scheduling of file copying. In addition, according to the free space expansion method using external space shown in one or more embodiments of the present invention, another guest os can be requested to share a part of the storage space to complete the file copying operation in real time, and by Detect the available disk space of the storage space, and notify the relevant personnel to deal with it in real time, so as to avoid affecting the operation of the guest os due to the storage space.
以上之關於本揭露內容之說明及以下之實施方式之說明係用以示範與解釋本發明之精神與原理,並且提供本發明之專利申請範圍更進一步之解釋。The above description of the present disclosure and the following description of the embodiments are used to demonstrate and explain the spirit and principle of the present invention, and provide further explanation of the scope of the patent application of the present invention.
以下在實施方式中詳細敘述本發明之詳細特徵以及優點,其內容足以使任何熟習相關技藝者了解本發明之技術內容並據以實施,且根據本說明書所揭露之內容、申請專利範圍及圖式,任何熟習相關技藝者可輕易地理解本發明相關之目的及優點。以下之實施例係進一步詳細說明本發明之觀點,但非以任何觀點限制本發明之範疇。The detailed features and advantages of the present invention are described in detail in the following embodiments, and the content is sufficient to enable any person skilled in the relevant art to understand the technical content of the present invention and implement it accordingly, and according to the content disclosed in this specification, the scope of the patent application and the drawings , any person skilled in the related art can easily understand the related objects and advantages of the present invention. The following examples further illustrate the viewpoints of the present invention in detail, but do not limit the scope of the present invention in any viewpoint.
請一併參考圖1及圖2,其中圖1係依據本發明一實施例所繪示的利用外部空間的可用空間擴充方法的示意圖;圖2係依據本發明一實施例所繪示的利用外部空間的可用空間擴充方法的流程圖。本發明所述的磁碟可以被分為多個儲存空間,且每一客戶端作業系統(guest operating system,下稱guest os)皆對應到個別的儲存空間,以供guest os將檔案寫入其預設對應的儲存空間。換句話說,一個磁碟可以具有多個虛擬機磁碟空間(下稱儲存空間),且每個儲存空間扣除系統保留空間後剩餘的空間即為磁碟可用空間。為便於理解,以下的實施例將以磁碟被分為第一儲存空間SP1及第二儲存空間SP2進行說明,且下述的guest os係預設對應到第一儲存空間SP1,然本發明不對儲存空間的數量及guest os預設對應的儲存空間予以限制。Please refer to FIG. 1 and FIG. 2 together, wherein FIG. 1 is a schematic diagram of a method for expanding available space by utilizing external space according to an embodiment of the present invention; FIG. 2 is a schematic diagram of utilizing an external space according to an embodiment of the present invention Flowchart of the available space augmentation method for the space. The disk of the present invention can be divided into a plurality of storage spaces, and each client operating system (guest operating system, hereinafter referred to as guest os) corresponds to a separate storage space for the guest os to write files into it. Default corresponding storage space. In other words, a disk can have multiple virtual machine disk spaces (hereinafter referred to as storage spaces), and the remaining space after deducting the system reserved space from each storage space is the available disk space. For ease of understanding, the following embodiments will be described with the disk divided into a first storage space SP1 and a second storage space SP2, and the following guest os is preset to correspond to the first storage space SP1, but the present invention does not The amount of storage space and the default storage space of the guest os are limited.
步驟S101:取得門檻時間。Step S101: Obtain the threshold time.
當guest os欲將一檔案FL寫入磁碟時,主機先將檔案FL的容量除以guest os的一訪客寫入速度,以取得對應該檔案FL的一門檻時間。簡言之,門檻時間指的是guest os將檔案FL寫入磁碟的儲存空間所需的時間。When the guest os wants to write a file FL to the disk, the host first divides the capacity of the file FL by a guest writing speed of the guest os to obtain a threshold time corresponding to the file FL. In short, the threshold time refers to the time required for the guest os to write the file FL into the storage space of the disk.
步驟S103:取得第一磁碟空間耗盡時間。Step S103: Obtain the first disk space exhaustion time.
對照圖1,第一儲存空間SP1可以具有一第一磁碟可用空間Ava1,主機可以將第一磁碟可用空間Ava1除以該訪客寫入速度以取得第一磁碟空間耗盡時間,而第一磁碟空間耗盡時間即為guest os若將第一磁碟可用空間Ava1全部耗損完所需的時間。舉例而言,第一磁碟可用空間Ava1例如為10G,而訪客寫入速度為10 Mb/sec,則第一磁碟空間耗盡時間大約為0.28小時。Referring to FIG. 1, the first storage space SP1 may have a first available disk space Ava1, the host may divide the first available disk space Ava1 by the guest write speed to obtain the first disk space exhaustion time, and the A disk space exhaustion time is the time required for the guest os to use up all the available space Ava1 of the first disk. For example, if the available space Ava1 of the first disk is, for example, 10G, and the guest writing speed is 10 Mb/sec, the first disk space exhaustion time is about 0.28 hours.
步驟S105:判斷第一磁碟空間耗盡時間是否小於門檻時間。Step S105: Determine whether the first disk space exhaustion time is less than the threshold time.
主機判斷第一磁碟空間耗盡時間是否小於門檻時間係為判斷第一磁碟可用空間Ava1是否足夠供檔案FL寫入。換言之,當第一磁碟空間耗盡時間小於門檻時間時,表示第一磁碟可用空間Ava1不足夠供檔案FL寫入,故可以發出警示通知至警示中心,以通知相關人員協助處理,然若主機具有足夠運算能力可以自行排除狀況,則發出警示通知的步驟亦可省略;反之,當第一磁碟空間耗盡時間不小於門檻時間時,表示第一磁碟可用空間Ava1足夠供檔案FL寫入。The host determines whether the first disk space exhaustion time is less than the threshold time to determine whether the available space Ava1 of the first disk is sufficient for the file FL to be written. In other words, when the first disk space exhaustion time is less than the threshold time, it means that the available space Ava1 of the first disk is not enough for the file FL to write, so an alert notification can be sent to the alert center to notify relevant personnel to assist in processing, but if If the host has enough computing power to eliminate the situation by itself, the step of issuing a warning notification can also be omitted; on the contrary, when the first disk space exhaustion time is not less than the threshold time, it means that the available space Ava1 of the first disk is sufficient for the file FL to write enter.
步驟S107:將檔案寫入第一磁碟可用空間。Step S107: Write the file into the free space of the first disk.
如上述,當第一磁碟空間耗盡時間不小於門檻時間時,表示第一磁碟可用空間Ava1足夠供檔案FL寫入,因此guest os即可將檔案FL寫入第一磁碟可用空間Ava1。As mentioned above, when the first disk space exhaustion time is not less than the threshold time, it means that the available space Ava1 of the first disk is sufficient for writing the file FL, so the guest os can write the file FL to the available space Ava1 of the first disk .
步驟S109:取得第二磁碟空間耗盡時間。Step S109: Obtain the second disk space exhaustion time.
當第一磁碟空間耗盡時間小於門檻時間時,表示第一磁碟可用空間Ava1不足夠供檔案FL寫入,因此主機可以將第二儲存空間SP2的第二磁碟可用空間Ava2除以該訪客寫入速度以取得第二磁碟空間耗盡時間,第二磁碟空間耗盡時間即為guest os若將第二磁碟可用空間Ava2全部耗損完所需的時間。具體而言,判斷第一磁碟可用空間Ava1不足夠供檔案FL寫入時再取得第二磁碟空間耗盡時間的目的在於,當第一磁碟可用空間Ava1不足時,可以請求其他的磁碟可用空間(在此實施例即為第二磁碟可用空間Ava2)協助抄寫檔案FL,以有效地運用其他磁碟可用空間,並協助後續作業的排程。When the first disk space exhaustion time is less than the threshold time, it means that the available space Ava1 of the first disk is not enough for the file FL to write, so the host can divide the available space Ava2 of the second disk of the second storage space SP2 by the The guest writing speed is used to obtain the second disk space exhaustion time. The second disk space exhaustion time is the time required for the guest os to use up all the available space Ava2 of the second disk. Specifically, the purpose of obtaining the space exhaustion time of the second disk when it is determined that the available space Ava1 of the first disk is insufficient for writing the file FL is to request other disks when the available space Ava1 of the first disk is insufficient. The disk free space (in this embodiment, the second disk free space Ava2) assists in copying the file FL, so as to effectively use the other disk free space and assist in the scheduling of subsequent operations.
步驟S111:判斷第二磁碟空間耗盡時間是否不小於門檻時間。Step S111: Determine whether the exhaustion time of the second disk space is not less than the threshold time.
相似於步驟S105,在取得第二磁碟空間耗盡時間後,判斷第二磁碟空間耗盡時間是否不小於門檻時間係藉此判斷第二磁碟可用空間Ava2是否足夠供檔案FL寫入。Similar to step S105 , after obtaining the second disk space exhaustion time, determining whether the second disk space exhaustion time is not less than the threshold time is used to determine whether the available space Ava2 of the second disk is sufficient for writing the file FL.
當判斷第二磁碟空間耗盡時間不小於門檻時間時(即第二磁碟空間耗盡時間等於或大於門檻時間)可以接續步驟S113:將檔案FL寫入第二磁碟可用空間Ava2。亦即,主機可以發出一空間共享請求至對應第二磁碟可用空間Ava2的作業系統(即另一guest os),以將該檔案FL抄寫進第二磁碟可用空間Ava2。When it is determined that the second disk space exhaustion time is not less than the threshold time (ie, the second disk space exhaustion time is equal to or greater than the threshold time), step S113 can be continued: write the file FL into the second disk available space Ava2. That is, the host can issue a space sharing request to the operating system (ie, another guest os) corresponding to the available space Ava2 of the second disk, so as to copy the file FL into the available space Ava2 of the second disk.
反之,當判斷第二磁碟空間耗盡時間小於門檻時間時,則可以接續步驟S115:判斷第一磁碟空間耗盡時間與第二磁碟空間耗盡時間之和是否不小於門檻時間。Conversely, when it is determined that the second disk space exhaustion time is less than the threshold time, step S115 may be continued: determining whether the sum of the first disk space exhaustion time and the second disk space exhaustion time is not less than the threshold time.
亦即,主機在取得第一磁碟空間耗盡時間及第二磁碟空間耗盡時間後,若判斷兩者皆小於門檻時間,則表示第一磁碟可用空間Ava1及第二磁碟可用空間Ava2皆不足供檔案FL寫入。因此,主機可以進一步判斷第一磁碟空間耗盡時間與第二磁碟空間耗盡時間之和與門檻時間之間的關係,以判斷第一磁碟可用空間Ava1及第二磁碟可用空間Ava2是否能夠共同地供檔案FL寫入。That is, after obtaining the first disk space exhaustion time and the second disk space exhaustion time, if the host determines that both of them are less than the threshold time, it means that the available space of the first disk Ava1 and the available space of the second disk are Ava2 is not enough for file FL to write. Therefore, the host can further determine the relationship between the sum of the first disk space exhaustion time and the second disk space exhaustion time and the threshold time, so as to determine the available space of the first disk Ava1 and the available space of the second disk Ava2 Whether the file FL can be written to in common.
詳細而言,判斷第一磁碟可用空間Ava1及第二磁碟可用空間Ava2是否能夠共同地供檔案FL寫入可以係基於如下的空間計算公式,以計算出第一磁碟可用空間Ava1及第二磁碟可用空間Ava2實際能夠用於儲存檔案FL的空間。Specifically, determining whether the available space Ava1 of the first disk and the available space Ava2 of the second disk can be jointly written by the file FL can be based on the following space calculation formula to calculate the available space of the first disk Ava1 and the available space of the second disk. Two disk free space Ava2 can actually be used to store the space of the file FL.
空間計算公式: 以第一磁碟可用空間Ava1為例, 係指第一磁碟可用空間Ava1實際能夠用於儲存檔案FL的空間; 係指第一磁碟可用空間Ava1中未被佔用的空間; 係指第一磁碟可用空間Ava1中可供其他檔案寫入的空間百分比。 Space calculation formula: Take the available space Ava1 of the first disk as an example, Refers to the space that the available space Ava1 of the first disk can actually use to store the file FL; means the unoccupied space in the available space Ava1 of the first disk; It refers to the percentage of space available for writing other files in the available space Ava1 of the first disk.
步驟S117:以第一磁碟可用空間與第二磁碟可用空間各抄寫檔案的一部分及另一部份。Step S117: Copy a part and another part of the file using the available space of the first disk and the available space of the second disk.
具體而言,當第一磁碟空間耗盡時間與第二磁碟空間耗盡時間之和不小於門檻時間時,表示第一磁碟可用空間Ava1及第二磁碟可用空間Ava2足夠共同地供檔案FL寫入,因此主機可以發出空間共享請求至對應第二磁碟可用空間Ava2的另一guest os,以由第一磁碟可用空間Ava1及第二磁碟可用空間Ava2各抄寫檔案FL的一部分及另一部份。換言之,請參照圖1,當第一磁碟空間耗盡時間與第二磁碟空間耗盡時間之和不小於門檻時間時,可以將第一磁碟可用空間Ava1串聯於第二磁碟可用空間Ava2,以將檔案FL的一部份抄寫入第一磁碟可用空間Ava1,另一部份抄寫入第二磁碟可用空間Ava2。Specifically, when the sum of the exhaustion time of the first disk space and the exhaustion time of the second disk space is not less than the threshold time, it means that the available space Ava1 of the first disk and the available space Ava2 of the second disk are sufficiently common to supply The file FL is written, so the host can issue a space sharing request to another guest os corresponding to the second disk free space Ava2 to copy a part of the file FL from the first disk free space Ava1 and the second disk free space Ava2 and another part. In other words, referring to FIG. 1 , when the sum of the first disk space exhaustion time and the second disk space exhaustion time is not less than the threshold time, the first disk free space Ava1 can be connected in series with the second disk free space Ava2, to copy a part of the file FL into the available space Ava1 of the first disk, and copy the other part into the available space Ava2 of the second disk.
反之,當第一磁碟空間耗盡時間與第二磁碟空間耗盡時間之和小於門檻時間時,表示即使串聯第一磁碟可用空間Ava1及第二磁碟可用空間Ava2仍不足夠供檔案FL寫入,因此主機可以執行步驟S119:取得第三磁碟空間耗盡時間。Conversely, when the sum of the exhaustion time of the first disk space and the exhaustion time of the second disk space is less than the threshold time, it means that the available space of the first disk Ava1 and the available space of the second disk Ava2 are still not enough for files. FL is written, so the host can execute step S119 : obtain the third disk space exhaustion time.
亦即,主機可以藉由第三磁碟空間耗盡時間,再接續判斷第三儲存空間的第三磁碟可用空間(未繪示於圖中)是否足夠供檔案FL寫入,或是第三磁碟可用空間與第一及第二磁碟可用空間之和是否足夠供檔案FL寫入。That is, the host can continue to determine whether the available space (not shown in the figure) of the third disk in the third storage space is enough for the file FL to be written, or the third disk Whether the sum of the free space of the disk and the free space of the first and second disks is enough for the file FL to be written.
除了前述guest os與guest os之間的溝通的使用情境之外,在其他實施例中,上述的實施例亦可以應用於host os與guest os之間的溝通,其中host os例如為監控每個guest os的中央伺服器。詳細來說,圖1及圖2的實施例可以用於銀行的中央伺服器(host os)及該銀行的其他分行的分行伺服器(guest os)。換言之,當桃園分行的伺服器的磁碟可用空間不足夠供一檔案寫入(即第一磁碟可用空間的第一磁碟空間耗盡時間小於門檻時間)時,桃園分行的伺服器可以通知銀行的中央伺服器,以由中央伺服器取得例如為新竹分行的伺服器的磁碟可用空間(第二磁碟可用空間),並在依據該檔案的容量、桃園分行的伺服器的寫入速度(訪客寫入速度)判得桃園分行的伺服器的磁碟可用空間的磁碟空間耗盡時間(第一磁碟空間耗盡時間),以及依據新竹分行的伺服器的磁碟可用空間(第二磁碟可用空間)及桃園分行的伺服器的寫入速度(訪客寫入速度)判得新竹分行的伺服器的磁碟可用空間的磁碟空間耗盡時間(第二磁碟空間耗盡時間),判斷桃園分行的伺服器的磁碟可用空間以及新竹分行的伺服器的磁碟可用空間足以共同供該檔案寫入時,中央伺服器即可控制由桃園分行及新竹分行的伺服器將該檔案分別寫入其各別的磁碟可用空間。反之,若中央伺服器判斷即使將桃園分行及新竹分行的伺服器的磁碟可用空間串聯仍不足以供該檔案寫入(第一磁碟空間耗盡時間與第二磁碟空間耗盡時間之和小於門檻時間)時,則中央伺服器可以進一步取得例如為苗栗分行的伺服器的磁碟可用空間(第三磁碟可用空間),以判斷苗栗分行的伺服器的磁碟可用空間是否足夠供該檔案寫入,或是桃園、新竹及苗栗分行的伺服器的磁碟可用空間是否足夠共同供該檔案寫入。In addition to the aforementioned usage scenarios of the communication between the guest os and the guest os, in other embodiments, the above-mentioned embodiments can also be applied to the communication between the host os and the guest os, where the host os, for example, monitors each guest os central server. In detail, the embodiments of FIGS. 1 and 2 can be used for a central server (host os) of a bank and branch servers (guest os) of other branches of the bank. In other words, when the free disk space of the server of Taoyuan Branch is not enough for a file to be written (that is, the first disk space exhaustion time of the first disk free space is less than the threshold time), the server of Taoyuan Branch can notify The central server of the bank obtains the free disk space (second disk free space) of the server of Hsinchu branch from the central server, and according to the capacity of the file, the writing speed of the server of Taoyuan branch (Visitor write speed) Determine the disk space exhaustion time of the available disk space of the server of Taoyuan Branch (the first disk space exhaustion time), and based on the available disk space of the server of Hsinchu Branch (the first disk space exhaustion time) The free space of the second disk) and the write speed of the server of Taoyuan Branch (the guest write speed) determine the disk space exhaustion time of the available disk space of the server of Hsinchu Branch (the second disk space exhaustion time) ), when it is judged that the available disk space of the server of Taoyuan Branch and the available disk space of the server of Hsinchu Branch are enough for the file to be written together, the central server can control the servers of Taoyuan Branch and Hsinchu Branch to write the file together. Files are written to their respective disk free space. Conversely, if the central server determines that even if the available disk space of the servers of Taoyuan Branch and Hsinchu Branch is concatenated, it is still not enough for the file to be written (the difference between the first disk space exhaustion time and the second disk space exhaustion time). and less than the threshold time), the central server can further obtain, for example, the available disk space of the server of the Miaoli branch (the third available disk space) to determine whether the available disk space of the server of the Miaoli branch is sufficient for Whether the file is written, or whether the available disk space of the servers of the Taoyuan, Hsinchu and Miaoli branches is sufficient for the file to be written.
此外,在取得第一磁碟空間耗盡時間及第二磁碟空間耗盡時間後,主機可以依據第一磁碟空間耗盡時間及第二磁碟空間耗盡時間的大小,由大到小或由小到大依序地記錄第一磁碟空間耗盡時間及第二磁碟空間耗盡時間於一可用空間清單,尤其當檔案FL很大需使用多個磁碟可用空間時,則主機更可以基於可用空間清單迅速判斷出可以用以供檔案FL寫入的磁碟可用空間。此外,主機亦可以是依據guest os的編號依序地記錄第一磁碟空間耗盡時間及第二磁碟空間耗盡時間於可用空間清單,本發明不對可用空間清單的記錄順序予以限制。In addition, after obtaining the first disk space exhaustion time and the second disk space exhaustion time, the host can select the first disk space exhaustion time and the second disk space exhaustion time in descending order according to the size of the first disk space exhaustion time and the second disk space exhaustion time Or record the first disk space exhaustion time and the second disk space exhaustion time in a free space list in order from small to large, especially when the file FL is very large and needs to use multiple free disk spaces, the host Furthermore, based on the free space list, the free space on the disk that can be used for writing the file FL can be quickly determined. In addition, the host may also sequentially record the first disk space exhaustion time and the second disk space exhaustion time in the available space list according to the number of the guest os, and the present invention does not limit the recording sequence of the available space list.
請參考以下的可用空間清單1,可用空間清單1的排序方式係依據第一磁碟空間耗盡時間及第二磁碟空間耗盡時間的大小,以由大到小的方式排序,故可用空間清單1中guest os1的第一磁碟空間耗盡時間排序於guest os2的第二磁碟空間耗盡時間之前。因此,當主機要判斷第一磁碟空間耗盡時間與第二磁碟空間耗盡時間之和是否不小於門檻時間之前,可以先判斷可用空間清單1中排序在前的第一磁碟空間耗盡時間是否小於門檻時間,而當主機判斷可用空間清單1中排序在前的第一磁碟空間耗盡時間小於門檻時間時,再接續判斷第一磁碟空間耗盡時間與第二磁碟空間耗盡時間之和是否不小於門檻時間。Please refer to the free space list 1 below. The sorting method of the free space list 1 is based on the size of the first disk space exhaustion time and the second disk space exhaustion time, in descending order, so the available space The first disk space exhaustion time of guest os1 in Listing 1 is sorted before the second disk space exhaustion time of guest os2. Therefore, when the host wants to determine whether the sum of the first disk space exhaustion time and the second disk space exhaustion time is not less than the threshold time, it can first determine the first disk space consumption in the available space list 1. Whether the exhaustion time is less than the threshold time, and when the host determines that the first disk space exhaustion time ranked first in the available space list 1 is less than the threshold time, it will continue to determine the first disk space exhaustion time and the second disk space Whether the sum of the exhaustion time is not less than the threshold time.
於實務上,主機可以是以定時或不定時的方式偵測各儲存空間的磁碟可用空間,並將各磁碟可用空間除以其個別對應的guest os的抄寫速度(訪客寫入速度),以將每一磁碟可用空間的當前磁碟空間耗盡時間記錄於可用空間清單。因此,當guest os要將檔案寫入其對應的磁碟可用空間或是其他guest os的磁碟可用空間時,主機可以有效率地參照可用空間清單以判斷要將檔案寫入哪一磁碟可用空間,而不需在每次收到檔案時都要再重新計算一次每個磁碟可用空間的磁碟空間耗盡時間。並且,當主機在取得當前磁碟空間耗盡時間後,若判斷某一磁碟可用空間的磁碟空間耗盡時間低於一門檻時間(例如,2小時)時,更可以發出通知至相關單位以請求相關人員協助處理。In practice, the host can detect the disk free space of each storage space in a timed or irregular manner, and divide the free space of each disk by its corresponding guest os copy speed (guest write speed), To record the current disk space exhaustion time of each disk free space in the free space list. Therefore, when the guest os wants to write the file to its corresponding disk free space or the disk free space of other guest os, the host can efficiently refer to the free space list to determine which disk is available to write the file to. space without having to recalculate the disk space exhaustion time per disk available space each time a file is received. In addition, when the host determines that the disk space exhaustion time of a certain disk available space is lower than a threshold time (for example, 2 hours) after obtaining the current disk space exhaustion time, it can also send a notification to the relevant unit. to request the assistance of relevant personnel.
舉例而言,請參考以下的可用空間清單1,若guest os1欲將檔案FL寫入第一儲存空間SP1時,其對應的門檻時間例如為2小時,則主機可以參考可用空間清單1,以判斷guest os1對應的第一磁碟可用空間Ava1是否足夠供檔案FL寫入。在此示例中,因第一磁碟可用空間Ava1的第一磁碟空間耗盡時間為3.5小時,大於2小時的門檻時間,故主機可以選擇由guest os1將檔案FL寫入第一磁碟可用空間Ava1。For example, please refer to the following available space list 1. If the guest os1 wants to write the file FL into the first storage space SP1, and the corresponding threshold time is, for example, 2 hours, the host can refer to the available space list 1 to determine Whether the available space Ava1 of the first disk corresponding to guest os1 is enough for the file FL to write. In this example, since the first disk space exhaustion time of the first disk available space Ava1 is 3.5 hours, which is greater than the threshold time of 2 hours, the host can choose to use guest os1 to write the file FL to the first disk. Space Ava1.
反之,若當前的可用空間清單為以下的可用空間清單2,因第一磁碟可用空間Ava1的第一磁碟空間耗盡時間為1.6小時,小於2小時的門檻時間,故主機可以先判斷第一磁碟空間耗盡時間與第二磁碟空間耗盡時間之和是否大於門檻時間。在此示例中,第一磁碟空間耗盡時間與第二磁碟空間耗盡時間之和(2.6小時)大於門檻時間(2小時),故主機可以串聯第一磁碟可用空間Ava1與第二磁碟可用空間Ava2,以由guest os1將檔案FL的一部份寫入第一磁碟可用空間Ava1,以及由guest os2將檔案FL的另一部份寫入第二磁碟可用空間Ava2。On the contrary, if the current free space list is the following free space list 2, since the first disk space exhaustion time of the first disk free space Ava1 is 1.6 hours, which is less than the threshold time of 2 hours, the host can first determine the first disk space. Whether the sum of the first disk space exhaustion time and the second disk space exhaustion time is greater than the threshold time. In this example, the sum of the first disk space exhaustion time and the second disk space exhaustion time (2.6 hours) is greater than the threshold time (2 hours), so the host can concatenate the first disk free space Ava1 with the second disk space exhaustion time (2.6 hours). The disk free space Ava2, so that the guest os1 writes a part of the file FL into the first disk free space Ava1, and the guest os2 writes another part of the file FL into the second disk free space Ava2.
可用空間清單1
可用空間清單2
此外,請接著一併參考圖1及圖3,其中圖3係依據本發明另一實施例所繪示的利用外部空間的可用空間擴充方法的流程圖。主機於圖2的步驟S111判斷第二磁碟空間耗盡時間不小於門檻時間後,而欲於步驟S113將檔案FL寫入第二磁碟可用空間Ava2之前,更可以先執行圖3所示的步驟S1121、S1123及S1125。In addition, please refer to FIG. 1 and FIG. 3 together, wherein FIG. 3 is a flowchart of a method for expanding available space using external space according to another embodiment of the present invention. After the host determines in step S111 of FIG. 2 that the space exhaustion time of the second disk is not less than the threshold time, and wants to write the file FL into the available space Ava2 of the second disk in step S113 , it may first execute the process shown in FIG. 3 . Steps S1121, S1123 and S1125.
步驟S1121:取得存有檔案的暫存空間的來源資訊。Step S1121: Obtain the source information of the temporary storage space where the file is stored.
亦即,於圖2的步驟S111判斷第二磁碟空間耗盡時間不小於門檻時間後,主機可以先取得存有檔案FL的暫存空間的來源資訊,其中所述的來源資訊例如是該暫存空間的識別碼、密碼等,本發明不以此為限。That is, after it is determined in step S111 of FIG. 2 that the second disk space exhaustion time is not less than the threshold time, the host can first obtain the source information of the temporary storage space where the file FL is stored, wherein the source information is, for example, the temporary storage space. The identification code, password, etc. of the storage space, the present invention is not limited to this.
步驟S1123:判斷來源資訊是否符合預存資訊。Step S1123: Determine whether the source information conforms to the pre-stored information.
主機於取得該暫存空間的來源資訊後,進一步判斷該來源資訊是否符合主機預存的預存資訊,以驗證該暫存空間的合法性。After obtaining the source information of the temporary storage space, the host further determines whether the source information conforms to the pre-stored information pre-stored by the host, so as to verify the legitimacy of the temporary storage space.
當主機判斷來源資訊不符合預存資訊時,主機即可執行步驟S1125:輸出警示通知至監控中心,以通知相關人員處理,避免第二磁碟可用空間Ava2遭非授權人士存取。When the host determines that the source information does not conform to the pre-stored information, the host may execute step S1125 : output a warning notification to the monitoring center to notify the relevant personnel to deal with it, so as to prevent the second disk free space Ava2 from being accessed by unauthorized persons.
而當主機判斷來源資訊符合預存資訊時,主機即可發送空間共享請求予第二磁碟可用空間對應的guest os,以執行如圖1所示的步驟S113由第二磁碟可用空間Ava2抄寫檔案FL。When the host determines that the source information matches the pre-stored information, the host can send a space sharing request to the guest os corresponding to the available space of the second disk, so as to perform step S113 as shown in FIG. 1 to copy the file from the available space of the second disk Ava2 FL.
請一併參考圖1及圖4,其中圖4係依據本發明再一實施例所繪示的利用外部空間的可用空間擴充方法的流程圖。主機於圖2的步驟S113將檔案FL寫入第二磁碟可用空間Ava2後,更可以執行圖4所示的步驟S114、S116、S118及S120。Please refer to FIG. 1 and FIG. 4 together, wherein FIG. 4 is a flowchart of a method for expanding available space by utilizing external space according to still another embodiment of the present invention. After the host writes the file FL into the available space Ava2 of the second disk in step S113 of FIG. 2 , the host may further execute steps S114 , S116 , S118 and S120 shown in FIG. 4 .
步驟S114:取得第一更新磁碟可用空間;步驟S116:取得第一更新磁碟空間耗盡時間 。Step S114: Obtain the available space of the first update disk; Step S116: Obtain the exhaustion time of the first update disk space.
如前述,主機可以定時或不定時地偵測第一儲存空間SP1(即偵測對應第一儲存空間SP1的第一虛擬機磁碟空間),以取得第一儲存空間SP1當前的第一磁碟可用空間Ava1,並以當前的第一磁碟可用空間Ava1作為第一更新磁碟可用空間。因此,在檔案FL寫入第二磁碟可用空間Ava2後,主機仍可以持續偵測第一儲存空間SP1以取得第一更新磁碟可用空間,並將該第一更新磁碟可用空間除以存有檔案FL的第二磁碟可用空間Ava2所對應的訪客寫入速度以取得一第一更新磁碟空間耗盡時間,主機更可以據以更新可用空間清單中所載的第一磁碟空間耗盡時間。As mentioned above, the host can periodically or irregularly detect the first storage space SP1 (ie, detect the first virtual machine disk space corresponding to the first storage space SP1) to obtain the current first disk of the first storage space SP1 The available space is Ava1, and the current first disk free space Ava1 is used as the first update disk free space. Therefore, after the file FL is written into the second disk free space Ava2, the host can continue to detect the first storage space SP1 to obtain the first update disk free space, and divide the first update disk free space by the storage space. The guest write speed corresponding to the free space Ava2 of the second disk with the file FL is obtained to obtain a first update disk space exhaustion time, and the host can also update the first disk space consumption in the free space list accordingly. as long as possible.
步驟S118:判斷第一更新磁碟空間耗盡時間是否不小於門檻時間。Step S118: Determine whether the exhaustion time of the first update disk space is not less than the threshold time.
相似於上述,當主機判斷第一更新磁碟空間耗盡時間不小於門檻時間時,表示第一儲存空間SP1已釋出至少一部份的空間,使原先的第一磁碟可用空間Ava1已擴大為足以供檔案FL寫入的第一更新磁碟可用空間。Similar to the above, when the host determines that the first update disk space exhaustion time is not less than the threshold time, it means that the first storage space SP1 has released at least a part of the space, so that the original first disk available space Ava1 has been expanded. Free space on the first update disk sufficient for the file FL to be written.
反之,當主機判斷第一更新磁碟空間耗盡時間小於門檻時間時,表示第一更新磁碟可用空間仍不足以供檔案FL寫入,因此主機可以接著執行步驟S114偵測第一儲存空間SP1,以取得另一第一更新磁碟可用空間。Conversely, when the host determines that the space exhaustion time of the first update disk is less than the threshold time, it means that the available space of the first update disk is still not enough for the file FL to be written, so the host can then perform step S114 to detect the first storage space SP1 , to get another first update disk free space.
步驟S120:將檔案抄寫至第一更新磁碟可用空間,並刪除第二磁碟可用空間中的檔案。Step S120: Copy the file to the free space of the first update disk, and delete the file in the free space of the second disk.
亦即,當判斷第一更新磁碟可用空間足以供檔案FL寫入時,則對應第二磁碟可用空間Ava2的guest os即可將檔案FL抄寫至第一更新磁碟可用空間,並刪除第二磁碟可用空間Ava2中所存的檔案FL。That is, when it is determined that the free space of the first update disk is sufficient for the file FL to be written, the guest os corresponding to the available space of the second disk Ava2 can copy the file FL to the free space of the first update disk, and delete the first update disk. The file FL stored in the available space Ava2 on the second disk.
綜上所述,依據本發明一或多個實施例所示的利用外部空間的可用空間擴充方法,不僅可以有效地利用閒置的儲存空間,並且,藉由以磁碟空間耗盡時間判斷要將檔案存入哪個儲存空間,更可以直覺地判斷問題排除的時間,以協助檔案抄寫的排程。此外,依據本發明一或多個實施例所示的利用外部空間的可用空間擴充方法,更可以請求另一guest os分享出一部份的儲存空間以即時地完成檔案抄寫的作業,並且藉由偵測儲存空間的磁碟可用空間,可以即時地通知相關人員處理,避免因儲存空間而影響到guest os的運作。To sum up, according to the available space expansion method using external space shown in one or more embodiments of the present invention, not only can the idle storage space be effectively used, but also the disk space exhaustion time can be used to determine whether to In which storage space the file is stored, it is possible to intuitively judge the time when the problem is eliminated, so as to assist in the scheduling of file copying. In addition, according to the free space expansion method using external space shown in one or more embodiments of the present invention, another guest os can be requested to share a part of the storage space to complete the file copying operation in real time, and by Detect the available disk space of the storage space, and notify the relevant personnel to deal with it in real time, so as to avoid affecting the operation of the guest os due to the storage space.
雖然本發明以前述之實施例揭露如上,然其並非用以限定本發明。在不脫離本發明之精神和範圍內,所為之更動與潤飾,均屬本發明之專利保護範圍。關於本發明所界定之保護範圍請參考所附之申請專利範圍。Although the present invention is disclosed in the foregoing embodiments, it is not intended to limit the present invention. Changes and modifications made without departing from the spirit and scope of the present invention belong to the scope of patent protection of the present invention. For the protection scope defined by the present invention, please refer to the attached patent application scope.
FL:檔案 SP1:第一儲存空間 SP2:第二儲存空間 Ava1:第一磁碟可用空間 Ava2:第二磁碟可用空間FL: Archives SP1: First storage space SP2: Second Storage Space Ava1: First Disk Free Space Ava2: 2nd disk free space
圖1係依據本發明一實施例所繪示的利用外部空間的可用空間擴充方法的示意圖。 圖2係依據本發明一實施例所繪示的利用外部空間的可用空間擴充方法的流程圖。 圖3係依據本發明另一實施例所繪示的利用外部空間的可用空間擴充方法的流程圖。 圖4係依據本發明再一實施例所繪示的利用外部空間的可用空間擴充方法的流程圖。 FIG. 1 is a schematic diagram of a method for expanding available space using external space according to an embodiment of the present invention. FIG. 2 is a flowchart of a method for expanding available space by utilizing external space according to an embodiment of the present invention. FIG. 3 is a flowchart of a method for expanding available space by utilizing external space according to another embodiment of the present invention. FIG. 4 is a flowchart of a method for expanding available space by utilizing external space according to yet another embodiment of the present invention.
FL:檔案 FL: Archives
SP1:第一儲存空間 SP1: First storage space
SP2:第二儲存空間 SP2: Second Storage Space
Ava1:第一磁碟可用空間 Ava1: First Disk Free Space
Ava2:第二磁碟可用空間 Ava2: 2nd disk free space
Claims (8)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW109146575A TWI764483B (en) | 2020-12-29 | 2020-12-29 | Method of expanding available space using external space |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW109146575A TWI764483B (en) | 2020-12-29 | 2020-12-29 | Method of expanding available space using external space |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| TWI764483B true TWI764483B (en) | 2022-05-11 |
| TW202225945A TW202225945A (en) | 2022-07-01 |
Family
ID=82594124
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| TW109146575A TWI764483B (en) | 2020-12-29 | 2020-12-29 | Method of expanding available space using external space |
Country Status (1)
| Country | Link |
|---|---|
| TW (1) | TWI764483B (en) |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20070106636A1 (en) * | 2005-11-07 | 2007-05-10 | Microsoft Corporation | Resource exhaustion prediction, detection, diagnosis and correction |
| US20070239954A1 (en) * | 2006-04-07 | 2007-10-11 | Yukinori Sakashita | Capacity expansion volume migration transfer method |
| CN103365781A (en) * | 2012-03-29 | 2013-10-23 | 国际商业机器公司 | Method and device for dynamically reconfiguring storage system |
| CN103547994A (en) * | 2011-05-20 | 2014-01-29 | 微软公司 | Cross-cloud computing for capacity management and disaster recovery |
| CN104915151A (en) * | 2015-06-02 | 2015-09-16 | 杭州电子科技大学 | Active sharing memory excessive allocation method in multi-virtual machine system |
| CN107851039A (en) * | 2015-09-18 | 2018-03-27 | 华为技术有限公司 | System and method for resource management |
-
2020
- 2020-12-29 TW TW109146575A patent/TWI764483B/en active
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20070106636A1 (en) * | 2005-11-07 | 2007-05-10 | Microsoft Corporation | Resource exhaustion prediction, detection, diagnosis and correction |
| US20070239954A1 (en) * | 2006-04-07 | 2007-10-11 | Yukinori Sakashita | Capacity expansion volume migration transfer method |
| CN103547994A (en) * | 2011-05-20 | 2014-01-29 | 微软公司 | Cross-cloud computing for capacity management and disaster recovery |
| CN103365781A (en) * | 2012-03-29 | 2013-10-23 | 国际商业机器公司 | Method and device for dynamically reconfiguring storage system |
| CN104915151A (en) * | 2015-06-02 | 2015-09-16 | 杭州电子科技大学 | Active sharing memory excessive allocation method in multi-virtual machine system |
| CN107851039A (en) * | 2015-09-18 | 2018-03-27 | 华为技术有限公司 | System and method for resource management |
Also Published As
| Publication number | Publication date |
|---|---|
| TW202225945A (en) | 2022-07-01 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US12216928B2 (en) | Fragment management method and fragment management apparatus | |
| US7895394B2 (en) | Storage system | |
| JP6529617B2 (en) | Selective retention of application program data to be migrated from system memory to non-volatile data storage | |
| US10248322B2 (en) | Memory system | |
| JP4808275B2 (en) | Network boot system | |
| JP2014513338A5 (en) | Method, computer readable storage medium and system for optimal compression of a virtual disk | |
| CN109144406B (en) | Metadata storage method, system and storage medium in distributed storage system | |
| CN101681237A (en) | Encryption device, encryption method, and encryption program | |
| US20240264762A1 (en) | Data Write Method and Related Device | |
| US8756386B2 (en) | Backup apparatus, backup method and computer readable medium having a backup program | |
| US7849264B2 (en) | Storage area management method for a storage system | |
| JP5381713B2 (en) | Data storage system for virtual machine, data storage method, and data storage program | |
| CN109669822A (en) | The creation method and computer readable storage medium of electronic device, spare memory pool | |
| CN109558068B (en) | Data migration method and migration system | |
| US20170075615A1 (en) | Storage system and storage control method | |
| TWI764483B (en) | Method of expanding available space using external space | |
| US11640343B2 (en) | Method for migrating data in a raid system having a protection pool of storage units | |
| US10268594B2 (en) | Implementing paging device selection based on wear-level data | |
| US11573723B2 (en) | Method for managing extents of a system having a protection pool | |
| US11733922B2 (en) | Method for data reconstruction in a RAID system having a protection pool of storage units | |
| US11748016B2 (en) | Method for adding disks in a raid system having a protection pool of storage units | |
| CN106933496A (en) | Manage the method and device of RAID | |
| US11144445B1 (en) | Use of compression domains that are more granular than storage allocation units | |
| WO2018055686A1 (en) | Information processing system | |
| US20250245106A1 (en) | Method for efficient spare pe allocation of a raid system |