44
技術社區[雲棲]
存儲那些事兒(一):異構虛擬化一種實現SMIS
1. 背景
企業存儲是企業信息係統管理很重要的組成部分。企業存儲包含了大量的數據,供大量人使用。對於航空係統和金融係統來說,信息存儲就更加重要了。 作為企業信息存儲,擴展性是非常重要的,因為現在企業對於空間的使用越來越多。
那麼一個企業可能會采用其他存儲廠商的產品,原來信息如何保留? 使用數據遷移功能(migration),可以將數據轉移到其他係統上。但是企業數據數以P級,還是占企業IT支出很大的一部分的。因此除非是熱點數據,否則大部分的數據肯定還是保留在原有係統上。那麼,如何保證這些原有係統可以正常使用呢?或者說,存儲產品如何管理其他存儲廠商的產品? 答案就是存儲產品支持異構虛擬化!
異構虛擬化指的是對第三方陣列的支持。這個技術最先由HDS引入高端存儲,後來各大存儲廠商也相繼支持。異構虛擬化給客戶帶來的價值主要有兩點,一是無縫接管原來的第三方陣列數據,統一管理;二是原來的數據可以享受高端存儲的高級數據服務功能,比如自動分層,遠程複製等等。一句話,保護投資,簡化管理。
本文講講述一種異構虛擬化的具體實現- Windows 8 如何通過System Center Virtual Machine Manager(SCVMM),管理第三方存儲廠商的存儲資源。管理是通過SMI-S(Storage Management Initiative Specification)協議實現的。
2. SMI-S技術背景
SMI-S是SNIA(全球網絡存儲工業協會)發起並主導,眾多存儲廠商共同參與開發的一種標準管理接口。其目標是在存儲網絡中的存儲設備和管理軟件之間提供標準化的通信方式,從而使存儲管理實現廠商無關性,提高管理效率、降低管理成本,促進存儲網絡的發展。一方麵,SMI-S為存儲管理提供了一個統一的理界麵,使用戶能夠在SAN中輕鬆的集成和管理來自多個廠商的產品,從而提升了靈活性、可管理性和可靠性;同時,用戶的資源利用率也將獲得極大的提高。
另一方麵,它為網絡存儲行業定義了一個全新、開放的開發模式,使存儲廠商能夠專注於附加值功能上,而省去了異構和專有接口開發整合所需的技術支持。SMI-S在統一理解存儲管理上對所有廠商都是至關重要的。有了一個公共平台,廠商就可以加速產品的開發進程,並且終端用戶可以更自由地選擇廠商,同時也降低了複雜性。
SMI-S是建立在一些已有的標準基礎上,主要是CIM(Common Information公共Model信息模型)和WBEM(Web-Based Enterprise Management基於Web的企業管理)。
WBEM是由DMTF(分布式管理工作組)負責開發的一套使用 Internet 標準技術的一體化企業計算管理環境。它提供了基於WEB技術的完整的工業統一管理工具。促進了完全不同技術和平台的數據交換。
CIM為WBEM的核心定義了一種分層次的、麵向對象的信息模型和架構,該架構可以為企業網絡管理整個範圍內的係統,網絡,應用程序和服務的信息管理提供公共定義,而且允許用戶擴充。它描述了管理的概念模型,可以使得用戶可以通過網絡在彼此的係統之間交換語義豐富的管理信息。
3. SMI-S的簡介
Well, it’s basically a cookbook that explains how to use the model elements to do useful work, like discover and provision storage. Actually, it has grown into multiple cookbooks now, divided into topics like Common Profiles, Block, Filesystems, Fabric, etc. The SNIA has active working groups updating the specification every year or two to keep up with the latest technologies. The current (recently) published version is 1.6.0, with some updates expected by the end of the year.
簡單翻譯一下。SMIS就像是一個食譜,說明了怎麼樣使用每個元素去實現相應的功能,比如發現存儲係統和使用存儲。它提供不同的食譜,被分成不同的主題,比如Common Profile, Block Profile(提供存儲係統的塊功能), Filesystems(文件係統操作,比如查詢,創建,修改,刪除,擴展),Fabric等等。
Model elements可以簡單的理解為class。比如Filesystems裏麵定義了class SNIA_FileExportService,來提供Filesystem的服務。比如使用SNIA_CreateExportedShare創建一個Filesystem或者叫ExportedShare。詳細的定義如下,通過它詳細的說明,我們可以看到對於編程來說,已經足夠。
// Copyright (c) 2013 SNIA. All rights reserved. // ================================================================== // SNIA_FileExportService // ================================================================== [Experimental, Version ( "1.5.0" ), UMLPackagePath ( "SNIA::FileServices" ), Description ( "Provides configuration support for exporting elements " "(\"files\") of a FileSystem. FileExportService(s) are hosted " "by a ComputerSystem that exports the files (these would be the " "Filer Servers in a NAS Head). These shared elements " "(FileShares) are accessed through ProtocolEndpoint(s) hosted " "by the File Servers that support the specified file-sharing " "protocol. FileShares are associated with this Service via " "ServiceAffectsElement and with the ProtocolEndpoint(s) via " "SAPAvailableForElement." ) ] class SNIA_FileExportService : CIM_FileExportService { [Description ( "This extrinsic method, SNIA_CreateExportedShare, starts " "a job to createa FileShare for a contained sub-element " "of a FileSystem (either aLogicalFile or its sub-class " "Directory). The output parameterTheShare returns a " "reference to the created FileShare. TheFileShare is " "hosted by the ComputerSystem that is the host of " "theFileExportService (i.e the File Server " "ComputerSystem) -- theHostedFileShare association will " "be surfaced. The FileShare willalso be associated to the" "short for 100 lines... Please refer to MOF file for detail info" "or more ServiceAccessPointsvia SAPAvailableForElement." ), ValueMap { "0", "1", "2", "3", "4", "10..0x1000", "0x1001", "0x1002..0x7FFF", "0x8000.." }, Values { "Job Completed with No Error", "Not Supported", "Unknown", "Timeout", "Failed", "DMTF Reserved", "Method Parameters Checked - Job Started", "Method Reserved", "Vendor Specific" } ] uint32 SNIA_CreateExportedShare( [Description ( "An end user relevant name for the FileShare being " "created. If NULL, then a implementation-supplied " "default name can be used. The value shall be " "stored in the \'ElementName\' property for the " "created FileShare." ), IN] string ElementName, [Description ( "An end user relevant comment for the FileShare " "being created. If NULL, then a " "implementation-supplied default comment can be " "used. The value shall be stored in the \'Comment\' " "property for the created element." ), IN] string Comment, [Description ( "Reference to the job (may be null if job completed)." ), OUT, IN ( false )] CIM_ConcreteJob REF Job, [Required, Description ( "A non-NULL reference indicating a FileSystem whose " "sub-element is being exported. \n" "As an OUT parameter, a reference to the FileSystem " "is returned. (Or should we not allow this to be an " "OUT parameter)." ), OUT, IN] CIM_LogicalElement REF Root, [Description ( "A string representing a path to the shared " "element, either file or directory, from the root " "directory of the FileSystem indicated by Root. \n" "If SharedElementPath is NULL or the empty string, " "it indicates the root directory of Root." ), IN] string SharedElementPath, [Description ( "The client-specified requirements for how the " "specified FileShare element is to be shared or " "exported by the FileExportService. This is an " "element of the ExportedFileShareSetting class, or " "a derived class, encoded as a string-valued " "embedded object parameter. If NULL or the empty " "string, the default configuration will be " "specified by the FileExportService." ), EmbeddedInstance ( "SNIA_ExportedFileShareSetting" ), IN] string Goal, [Description ( "This specifies the FileShare element (or its " "derived class) that is created by the method, if " "successful." ), OUT] SNIA_FileShare REF TheShare, [Description ( "A reference to a concrete derived class of " "CIM_Identity that indicates the user id to use for " "default access to this share. A NULL value " "indicates that no user id is specified. The " "provider is expected to surface this access using " "the privilege model.\n" "If a default user id is not supported by the " "requested file sharing protocol this parameter " "will be ignored ." ), IN] CIM_Identity REF DefaultUserId, [Description ( "An array of strings that specify the hosts that " "have root access to this Share, if the " "ExportedFileShareSetting.RootAccess property is " "set to \"Allow Root Access\".\n" "Each entry specifies a host by a URI. All entries " "up to thefirst empty string are allowed root " "access; the entries afterthe first empty string " "are denied root access. If thisparameter is NULL, " "root access will be denied to all " "hosts,effectively overriding the value of the " "propertyExportedFileShareSetting.RootAccess. If " "the first entry isthe empty string, root access " "will be allowed from all hosts,and subsequent " "entries will be denied root access. Theprovider is " "expected to surface this access using theprivilege " "model. This property needs to be an array of " "URIsbecause the remote host may not be known to " "the provider andtherefore a valid reference to the " "host may not exist. \n" "If Root Access is not supported by the requested " "file sharing protocol this parameter will be " "ignored." ), ArrayType ( "Indexed" ), ModelCorrespondence { "SNIA_ExportedFileShareSetting.RootAccess" }, IN] string RootAccessHosts[], [Description ( "An array of references to the ProtocolEndpoints " "that canconnect to this Share, if " "theExportedFileShareSettings.AccessPoints property " "is set to\"Named Ports\". If the parameter is " "NULL, all access points willbe denied access, " "effectively overriding the value of theproperty " "ExportedFileShareSetting.AccessPoints. If the " "firstentry in the array is NULL, all access points " "supported by theservice will be supported, and " "subsequent entries will bedenied access. The " "provider is expected to surface these accessrights " "(whether granted or denied) using the privilege " "model.Any AccessPoints granted access via this " "parameter will also beassociated to this share " "with SAPAvailableForElement. If theAccessPoint is " "not already enabled it will appear in a " "disabledstate. \n" "If multiple Access points or ports is not " "supported by the requested file sharing protocol " "this parameter will be ignored ." ), ArrayType ( "Indexed" ), ModelCorrespondence { "SNIA_ExportedFileShareSetting.AccessPoints" }, IN] string AccessPointPorts[] ); uint32 SNIA_ModifyExportedShare( string ElementName, string Comment, CIM_ConcreteJob REF Job, CIM_LogicalElement REF Root, string SharedElementPath, string Goal, SNIA_FileShare REF TheShare, CIM_Identity REF DefaultUserId, string RootAccessHosts[], string AccessPointPorts[], [Description ( "An enumerated integer that specifies the action " "that the provider should take if the FileShare is " "still in use when this request is made. The " "WaitTime parameter indicates the \'specified time\' " "used for this function. \n" "This option is only relevant if the FileShare must " "be made unavailable while the request is being " "executed." ), ValueMap { "2", "3", "4", "..", "0x1000..0xFFFF" }, Values { "Do Not Execute Request", "Wait for specified time, then Execute Request Immediately", "Attempt Quiescence for specified time, then Execute Request Immediately", "DMTF Reserved", "Vendor Defined" }, IN] uint16 InUseOptions, [Description ( "An integer that indicates the time (in seconds) " "that the provider must wait before executing this " "request if it cannot be done while the FileShare " "is in use. If WaitTime is not zero, the method " "will create a job, if supported by the provider, " "and return immediately. If the provider does not " "support asynchronous jobs, there is a possibility " "that the client could time-out before the job is " "completed. \n" "The combination of InUseOptions = \"4\" and " "WaitTime =\"0\" (the default) is interpreted as " "\"Wait (forever) until Quiescence, then Execute " "Request\" and will be performed asynchronously if " "possible." ), Units ( "seconds" ), IN] uint32 WaitTime ); [Override ( "ReleaseExportedShare" ), Description ( "This extrinsic method, ReleaseExportedShare will start a " "job to removea FileShare specified by the parameter " "TheShare. Any associatedinstances and associations that " "are no longer needed will not besurfaced any more. These " "include associations HostedShare,ElementSettingData, and " "any other elements and associations created tosupport " "the DefaultUserId, RootAccessHosts, and " "AccessPointPortsparameters. In addition, the " "ExportedFileShareSetting will be deletedif appropriate. " "The elements removed will include the Directory " "(orLogicalFile) if one had been surfaced explicitly for " "this FileShare(for backward compatability with SIM-S 1.1).\n" "If 0 is returned, the method completed successfully and " "no ConcreteJob instance was required. If 0x1000 is " "returned, a ConcreteJob will be started to release the " "Share. The Job\'s reference will be returned in the OUT " "parameter Job. \n" "The input parameters InUseOptions and WaitTime provide " "for delaying oraborting the execution of this method if " "the FileShare is in use and the method requires that no " "operations be in progress during that execution. These " "parameters are supported if the " "ExportedFileShareCapabilities.SupportedProperties " "includes the \"RequireInUseOptions\" option." ), ValueMap { "0", "1", "2", "3", "4", "5", "10", "..", "0x1000", "0x1001..0x7FFF", "0x8000.." }, Values { "Job Completed with No Error", "Not Supported", "Unknown", "Timeout", "Failed", "Invalid Parameter", "Share in use, Failed", "DMTF Reserved", "Method Parameters Checked - Job Started", "Method Reserved", "Vendor Specific" } ] uint32 ReleaseExportedShare( [Description ( "Reference to the job (may be null if job completed)." ), OUT, IN ( false )] CIM_ConcreteJob REF Job, [Description ( "The Share to be released." ), IN] SNIA_FileShare REF TheShare, [Description ( "An enumerated integer that specifies the action " "that the provider should take if the FileShare is " "still in use when this request is made. The " "WaitTime parameter indicates the \'specified time\' " "used for this function. \n" "This option is only relevant if the FileShare must " "be made unavailable while the request is being " "executed." ), ValueMap { "2", "3", "4", "..", "0x1000..0xFFFF" }, Values { "Do Not Execute Request", "Wait for specified time, then Release Immediately", "Attempt Quiescence for specified time, then Release Immediately", "DMTF Reserved", "Vendor Defined" }, IN] uint16 InUseOptions, [Description ( "An integer that indicates the time (in seconds) " "that the provider must wait before releasing this " "FileShare. If WaitTime is not zero, the method " "will create a job, if supported by the provider, " "and return immediately. If the provider does not " "support asynchronous jobs, there is a possibility " "that the client could time-out before the job is " "completed. \n" "The combination of InUseOptions = \'4\' and " "WaitTime =\'0\' (the default) is interpreted as " "\'Wait (forever) until Quiescence, then Release\' " "and will be performed asynchronously if possible." ), Units ( "seconds" ), IN] uint32 WaitTime ); };
對於開發人員來說,這個就相當於非常詳細的Programer Document了。這個class定義在MOF文件中。那麼什麼是MOF呢?
The Common Information Model (CIM) is described in the DMTF's Managed Object Format (MOF), a language based on IDL (the Object Management Group's Interface Definition Language). The MOF syntax is a way to describe object-oriented class and instance definitions in textual form, with the goals of human readability and parsing by a compiler.
通過MOF Compiler,這個MOF文件會生成C++或Java的class文件,開發人員隻需要將需要修改的函數實現即可。
關於SMI-S的所有MOF文件可以通過下麵這個銜接下載:SNIA_MOFS-16Rev4-Updated.zip。 CIM Schema可以通過下麵這個銜接下載:cim_schema_v2291
4. SMI-S的實現
首先需要讀懂SMI-S的官方文檔:Download 1.6。然後根據實際需要,選擇實現不同的Profile。對於Mandatory的class及class的Property(屬性),都是需要強製實現的。下麵是File Export Manipulation的Profile,需要實現的class,method還是很多的:
實現的SMI-S需要部署在存儲係統上或者是在存儲係統局域網內的Agent上。理論上來說,這個SMI-S的實現可以部署在任何地方,但是考慮到安全性,網絡延時,效率,一般都是直接運行在存儲係統上。
接下來在下一節將介紹如何使用SMI-S來管理存儲係統,也就是SMI-S的client。
5. 通過SMI-S管理存儲係統
通過MOF文件,和SMI-S的文檔,我們可以實現SMI-S的服務器端-部署在存儲係統上。通過第2小節我們知道,SMI-S是建立在一些已有的標準基礎上,主要是CIM(Common Information公共Model信息模型)和WBEM(Web-Based Enterprise Management基於Web的企業管理)。介紹一個非常強大的Python庫:PyWBEM: PyWBEM is a Python library for making CIM operations over HTTP using the WBEM CIM-XML protocol. It is based on the idea that a good WBEM client should be easy to use and not necessarily require a large amount of programming knowledge. PyWBEM is suitable for a large range of tasks from simply poking around to writing web and GUI applications.
項目主頁:https://sourceforge.net/apps/mediawiki/pywbem/index.php?title=Main_Page。Client_Examples基本涵蓋了開發客戶端需要用到的所有接口。
下麵幾種是我沒有用過的。當然了我也不知道Microsoft具體是使用的什麼。但不管怎麼說,我們已經達到目的了:使用SMI-S使存儲係統支持異構虛擬化。
Open Pegasus是CIM與WBEM標準的開源實現。它由 C++ 編寫,所以可以很方便的將麵向對象的CIM管理對象轉變成程序模塊。因此他被各個操作係統平台所支撐,包括 UNIX, Linux, OpenVMS, and Microsoft Windows。
WBEM Services是用Java編寫的,適用於任何商業和非商業用途的,基於WBEM的實現。它的內容包括運用編程接口,服務器端和客戶端的運用程序和工具。
SFCB(Small Footprint CIM Broker) 是一個輕量級的CIMOM,十分適用於嵌入式環境的開發。
6. SMI-S測試
SNIA-CTP(Conformance Testing Program)官方標準測試的工具。SNIA有自己的工作室ICTP(Interoperability Conformance Test Program)專門負責SMI-S支持度測試。如果通過了CTP測試,那麼SNIA就會有官方的certificate,這應該是唯一有說服力的certificate。
最後更新:2017-04-03 12:54:38