€•ð\Œsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ4/translations/zh_CN/admin-guide/device-mapper/switch”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ4/translations/zh_TW/admin-guide/device-mapper/switch”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ4/translations/it_IT/admin-guide/device-mapper/switch”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ4/translations/ja_JP/admin-guide/device-mapper/switch”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ4/translations/ko_KR/admin-guide/device-mapper/switch”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ4/translations/sp_SP/admin-guide/device-mapper/switch”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒ dm-switch”h]”hŒ dm-switch”…””}”(hh¨hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hh£hžhhŸŒN/var/lib/git/docbuild/linux/Documentation/admin-guide/device-mapper/switch.rst”h KubhŒ paragraph”“”)”}”(hŒñThe device-mapper switch target creates a device that supports an arbitrary mapping of fixed-size regions of I/O across a fixed set of paths. The path used for any specific region can be switched dynamically by sending the target a message.”h]”hŒñThe device-mapper switch target creates a device that supports an arbitrary mapping of fixed-size regions of I/O across a fixed set of paths. The path used for any specific region can be switched dynamically by sending the target a message.”…””}”(hh¹hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khh£hžhubh¸)”}”(hŒÞIt maps I/O to underlying block devices efficiently when there is a large number of fixed-sized address regions but there is no simple pattern that would allow for a compact representation of the mapping such as dm-stripe.”h]”hŒÞIt maps I/O to underlying block devices efficiently when there is a large number of fixed-sized address regions but there is no simple pattern that would allow for a compact representation of the mapping such as dm-stripe.”…””}”(hhÇhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K hh£hžhubh¢)”}”(hhh]”(h§)”}”(hŒ Background”h]”hŒ Background”…””}”(hhØhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hhÕhžhhŸh¶h Kubh¸)”}”(hX³Dell EqualLogic and some other iSCSI storage arrays use a distributed frameless architecture. In this architecture, the storage group consists of a number of distinct storage arrays ("members") each having independent controllers, disk storage and network adapters. When a LUN is created it is spread across multiple members. The details of the spreading are hidden from initiators connected to this storage system. The storage group exposes a single target discovery portal, no matter how many members are being used. When iSCSI sessions are created, each session is connected to an eth port on a single member. Data to a LUN can be sent on any iSCSI session, and if the blocks being accessed are stored on another member the I/O will be forwarded as required. This forwarding is invisible to the initiator. The storage layout is also dynamic, and the blocks stored on disk may be moved from member to member as needed to balance the load.”h]”hX·Dell EqualLogic and some other iSCSI storage arrays use a distributed frameless architecture. In this architecture, the storage group consists of a number of distinct storage arrays (“membersâ€) each having independent controllers, disk storage and network adapters. When a LUN is created it is spread across multiple members. The details of the spreading are hidden from initiators connected to this storage system. The storage group exposes a single target discovery portal, no matter how many members are being used. When iSCSI sessions are created, each session is connected to an eth port on a single member. Data to a LUN can be sent on any iSCSI session, and if the blocks being accessed are stored on another member the I/O will be forwarded as required. This forwarding is invisible to the initiator. The storage layout is also dynamic, and the blocks stored on disk may be moved from member to member as needed to balance the load.”…””}”(hhæhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KhhÕhžhubh¸)”}”(hXThis architecture simplifies the management and configuration of both the storage group and initiators. In a multipathing configuration, it is possible to set up multiple iSCSI sessions to use multiple network interfaces on both the host and target to take advantage of the increased network bandwidth. An initiator could use a simple round robin algorithm to send I/O across all paths and let the storage array members forward it as necessary, but there is a performance advantage to sending data directly to the correct member.”h]”hXThis architecture simplifies the management and configuration of both the storage group and initiators. In a multipathing configuration, it is possible to set up multiple iSCSI sessions to use multiple network interfaces on both the host and target to take advantage of the increased network bandwidth. An initiator could use a simple round robin algorithm to send I/O across all paths and let the storage array members forward it as necessary, but there is a performance advantage to sending data directly to the correct member.”…””}”(hhôhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K!hhÕhžhubh¸)”}”(hX0A device-mapper table already lets you map different regions of a device onto different targets. However in this architecture the LUN is spread with an address region size on the order of 10s of MBs, which means the resulting table could have more than a million entries and consume far too much memory.”h]”hX0A device-mapper table already lets you map different regions of a device onto different targets. However in this architecture the LUN is spread with an address region size on the order of 10s of MBs, which means the resulting table could have more than a million entries and consume far too much memory.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K*hhÕhžhubh¸)”}”(hŒUUsing this device-mapper switch target we can now build a two-layer device hierarchy:”h]”hŒUUsing this device-mapper switch target we can now build a two-layer device hierarchy:”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K0hhÕhžhubhŒ block_quote”“”)”}”(hŒ…Upper Tier - Determine which array member the I/O should be sent to. Lower Tier - Load balance amongst paths to a particular member. ”h]”h¸)”}”(hŒ„Upper Tier - Determine which array member the I/O should be sent to. Lower Tier - Load balance amongst paths to a particular member.”h]”hŒ„Upper Tier - Determine which array member the I/O should be sent to. Lower Tier - Load balance amongst paths to a particular member.”…””}”(hj$hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K3hj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhŸh¶h K3hhÕhžhubh¸)”}”(hXmThe lower tier consists of a single dm multipath device for each member. Each of these multipath devices contains the set of paths directly to the array member in one priority group, and leverages existing path selectors to load balance amongst these paths. We also build a non-preferred priority group containing paths to other array members for failover reasons.”h]”hXmThe lower tier consists of a single dm multipath device for each member. Each of these multipath devices contains the set of paths directly to the array member in one priority group, and leverages existing path selectors to load balance amongst these paths. We also build a non-preferred priority group containing paths to other array members for failover reasons.”…””}”(hj8hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K6hhÕhžhubh¸)”}”(hXuThe upper tier consists of a single dm-switch device. This device uses a bitmap to look up the location of the I/O and choose the appropriate lower tier device to route the I/O. By using a bitmap we are able to use 4 bits for each address range in a 16 member group (which is very large for us). This is a much denser representation than the dm table b-tree can achieve.”h]”hXuThe upper tier consists of a single dm-switch device. This device uses a bitmap to look up the location of the I/O and choose the appropriate lower tier device to route the I/O. By using a bitmap we are able to use 4 bits for each address range in a 16 member group (which is very large for us). This is a much denser representation than the dm table b-tree can achieve.”…””}”(hjFhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K=hhÕhžhubh¢)”}”(hhh]”(h§)”}”(hŒConstruction Parameters”h]”hŒConstruction Parameters”…””}”(hjWhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjThžhhŸh¶h KEubj)”}”(hX [...] [ ]+ The number of paths across which to distribute the I/O. The number of 512-byte sectors in a region. Each region can be redirected to any of the available paths. The number of optional arguments. Currently, no optional arguments are supported and so this must be zero. The block device that represents a specific path to the device. The offset of the start of data on the specific (in units of 512-byte sectors). This number is added to the sector number when forwarding the request to the specific path. Typically it is zero. ”h]”hŒdefinition_list”“”)”}”(hhh]”hŒdefinition_list_item”“”)”}”(hXÝ [...] [ ]+ The number of paths across which to distribute the I/O. The number of 512-byte sectors in a region. Each region can be redirected to any of the available paths. The number of optional arguments. Currently, no optional arguments are supported and so this must be zero. The block device that represents a specific path to the device. The offset of the start of data on the specific (in units of 512-byte sectors). This number is added to the sector number when forwarding the request to the specific path. Typically it is zero. ”h]”(hŒterm”“”)”}”(hŒY [...] [ ]+”h]”hŒY [...] [ ]+”…””}”(hjvhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthŸh¶h KYhjpubhŒ definition”“”)”}”(hhh]”jj)”}”(hhh]”(jo)”}”(hŒD The number of paths across which to distribute the I/O. ”h]”(ju)”}”(hŒ ”h]”hŒ ”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthŸh¶h KIhjŒubj…)”}”(hhh]”h¸)”}”(hŒ7The number of paths across which to distribute the I/O.”h]”hŒ7The number of paths across which to distribute the I/O.”…””}”(hj¡hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KIhjžubah}”(h]”h ]”h"]”h$]”h&]”uh1j„hjŒubeh}”(h]”h ]”h"]”h$]”h&]”uh1jnhŸh¶h KIhj‰ubjo)”}”(hŒw The number of 512-byte sectors in a region. Each region can be redirected to any of the available paths. ”h]”(ju)”}”(hŒ ”h]”hŒ ”…””}”(hj¿hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthŸh¶h KMhj»ubj…)”}”(hhh]”h¸)”}”(hŒhThe number of 512-byte sectors in a region. Each region can be redirected to any of the available paths.”h]”hŒhThe number of 512-byte sectors in a region. Each region can be redirected to any of the available paths.”…””}”(hjÐhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KLhjÍubah}”(h]”h ]”h"]”h$]”h&]”uh1j„hj»ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jnhŸh¶h KMhj‰ubjo)”}”(hŒ The number of optional arguments. Currently, no optional arguments are supported and so this must be zero. ”h]”(ju)”}”(hŒ”h]”hŒ”…””}”(hjîhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthŸh¶h KQhjêubj…)”}”(hhh]”h¸)”}”(hŒjThe number of optional arguments. Currently, no optional arguments are supported and so this must be zero.”h]”hŒjThe number of optional arguments. Currently, no optional arguments are supported and so this must be zero.”…””}”(hjÿhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KPhjüubah}”(h]”h ]”h"]”h$]”h&]”uh1j„hjêubeh}”(h]”h ]”h"]”h$]”h&]”uh1jnhŸh¶h KQhj‰ubjo)”}”(hŒK The block device that represents a specific path to the device. ”h]”(ju)”}”(hŒ ”h]”hŒ ”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthŸh¶h KThjubj…)”}”(hhh]”h¸)”}”(hŒ?The block device that represents a specific path to the device.”h]”hŒ?The block device that represents a specific path to the device.”…””}”(hj.hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KThj+ubah}”(h]”h ]”h"]”h$]”h&]”uh1j„hjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jnhŸh¶h KThj‰ubjo)”}”(hŒÖ The offset of the start of data on the specific (in units of 512-byte sectors). This number is added to the sector number when forwarding the request to the specific path. Typically it is zero. ”h]”(ju)”}”(hŒ”h]”hŒ”…””}”(hjLhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthŸh¶h KYhjHubj…)”}”(hhh]”h¸)”}”(hŒÌThe offset of the start of data on the specific (in units of 512-byte sectors). This number is added to the sector number when forwarding the request to the specific path. Typically it is zero.”h]”hŒÌThe offset of the start of data on the specific (in units of 512-byte sectors). This number is added to the sector number when forwarding the request to the specific path. Typically it is zero.”…””}”(hj]hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KWhjZubah}”(h]”h ]”h"]”h$]”h&]”uh1j„hjHubeh}”(h]”h ]”h"]”h$]”h&]”uh1jnhŸh¶h KYhj‰ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jihj†ubah}”(h]”h ]”h"]”h$]”h&]”uh1j„hjpubeh}”(h]”h ]”h"]”h$]”h&]”uh1jnhŸh¶h KYhjkubah}”(h]”h ]”h"]”h$]”h&]”uh1jihjeubah}”(h]”h ]”h"]”h$]”h&]”uh1jhŸh¶h KGhjThžhubeh}”(h]”Œconstruction-parameters”ah ]”h"]”Œconstruction parameters”ah$]”h&]”uh1h¡hhÕhžhhŸh¶h KEubh¢)”}”(hhh]”(h§)”}”(hŒMessages”h]”hŒMessages”…””}”(hj hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjhžhhŸh¶h K\ubh¸)”}”(hŒPset_region_mappings : []: []:...”h]”hŒPset_region_mappings : []: []:...”…””}”(hj®hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K^hjhžhubh¸)”}”(hŒRModify the region table by specifying which regions are redirected to which paths.”h]”hŒRModify the region table by specifying which regions are redirected to which paths.”…””}”(hj¼hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K`hjhžhubjj)”}”(hhh]”(jo)”}”(hŒË The region number (region size was specified in constructor parameters). If index is omitted, the next region (previous index + 1) is used. Expressed in hexadecimal (WITHOUT any prefix like 0x). ”h]”(ju)”}”(hŒ”h]”hŒ”…””}”(hjÑhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthŸh¶h KfhjÍubj…)”}”(hhh]”h¸)”}”(hŒÂThe region number (region size was specified in constructor parameters). If index is omitted, the next region (previous index + 1) is used. Expressed in hexadecimal (WITHOUT any prefix like 0x).”h]”hŒÂThe region number (region size was specified in constructor parameters). If index is omitted, the next region (previous index + 1) is used. Expressed in hexadecimal (WITHOUT any prefix like 0x).”…””}”(hjâhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Kdhjßubah}”(h]”h ]”h"]”h$]”h&]”uh1j„hjÍubeh}”(h]”h ]”h"]”h$]”h&]”uh1jnhŸh¶h KfhjÊubjo)”}”(hŒw The path number in the range 0 ... ( - 1). Expressed in hexadecimal (WITHOUT any prefix like 0x). ”h]”(ju)”}”(hŒ ”h]”hŒ ”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthŸh¶h Kjhjüubj…)”}”(hhh]”h¸)”}”(hŒlThe path number in the range 0 ... ( - 1). Expressed in hexadecimal (WITHOUT any prefix like 0x).”h]”hŒlThe path number in the range 0 ... ( - 1). Expressed in hexadecimal (WITHOUT any prefix like 0x).”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Kihjubah}”(h]”h ]”h"]”h$]”h&]”uh1j„hjüubeh}”(h]”h ]”h"]”h$]”h&]”uh1jnhŸh¶h KjhjÊhžhubjo)”}”(hŒ¨R, This parameter allows repetitive patterns to be loaded quickly. and are hexadecimal numbers. The last mappings are repeated in the next slots. ”h]”(ju)”}”(hŒR,”h]”hŒR,”…””}”(hj/hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthŸh¶h Kohj+ubj…)”}”(hhh]”h¸)”}”(hŒžThis parameter allows repetitive patterns to be loaded quickly. and are hexadecimal numbers. The last mappings are repeated in the next slots.”h]”hŒžThis parameter allows repetitive patterns to be loaded quickly. and are hexadecimal numbers. The last mappings are repeated in the next slots.”…””}”(hj@hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Kmhj=ubah}”(h]”h ]”h"]”h$]”h&]”uh1j„hj+ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jnhŸh¶h KohjÊhžhubeh}”(h]”h ]”h"]”h$]”h&]”uh1jihjhžhhŸh¶h Nubeh}”(h]”Œmessages”ah ]”h"]”Œmessages”ah$]”h&]”uh1h¡hhÕhžhhŸh¶h K\ubh¢)”}”(hhh]”(h§)”}”(hŒStatus”h]”hŒStatus”…””}”(hjkhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjhhžhhŸh¶h Krubh¸)”}”(hŒNo status line is reported.”h]”hŒNo status line is reported.”…””}”(hjyhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Kthjhhžhubeh}”(h]”Œstatus”ah ]”h"]”Œstatus”ah$]”h&]”uh1h¡hhÕhžhhŸh¶h Krubh¢)”}”(hhh]”(h§)”}”(hŒExample”h]”hŒExample”…””}”(hj’hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjhžhhŸh¶h Kwubh¸)”}”(hŒTAssume that you have volumes vg1/switch0 vg1/switch1 vg1/switch2 with the same size.”h]”hŒTAssume that you have volumes vg1/switch0 vg1/switch1 vg1/switch2 with the same size.”…””}”(hj hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Kyhjhžhubh¸)”}”(hŒ.Create a switch device with 64kB region size::”h]”hŒ-Create a switch device with 64kB region size:”…””}”(hj®hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K|hjhžhubhŒ literal_block”“”)”}”(hŒ‘dmsetup create switch --table "0 `blockdev --getsz /dev/vg1/switch0` switch 3 128 0 /dev/vg1/switch0 0 /dev/vg1/switch1 0 /dev/vg1/switch2 0"”h]”hŒ‘dmsetup create switch --table "0 `blockdev --getsz /dev/vg1/switch0` switch 3 128 0 /dev/vg1/switch0 0 /dev/vg1/switch1 0 /dev/vg1/switch2 0"”…””}”hj¾sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1j¼hŸh¶h K~hjhžhubh¸)”}”(hŒxSet mappings for the first 7 entries to point to devices switch0, switch1, switch2, switch0, switch1, switch2, switch1::”h]”hŒwSet mappings for the first 7 entries to point to devices switch0, switch1, switch2, switch0, switch1, switch2, switch1:”…””}”(hjÎhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khjhžhubj½)”}”(hŒBdmsetup message switch 0 set_region_mappings 0:0 :1 :2 :0 :1 :2 :1”h]”hŒBdmsetup message switch 0 set_region_mappings 0:0 :1 :2 :0 :1 :2 :1”…””}”hjÜsbah}”(h]”h ]”h"]”h$]”h&]”jÌjÍuh1j¼hŸh¶h K„hjhžhubh¸)”}”(hŒ&Set repetitive mapping. This command::”h]”hŒ%Set repetitive mapping. This command:”…””}”(hjêhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K†hjhžhubj½)”}”(hŒ