I use the free hypervisor hyper-v from Microsoft quite often. The free edition is based on the core version of the server. This causes some inconvenience in solving standard tasks that you don’t even think about when working on a full-fledged version of the server with graphical interface. One of these tasks was adding a disk via iSCSI.

Data Engineer Online Course– for developers, DBMS administrators and anyone who seeks to improve their professional level, master new tools and engage in interesting tasks in the field of working with big data. The course is not for beginners - you need to pass it.

In the standard GUI version of the server, this is done simply through the control panel. There is a separate section for this.

There is also equipment for the same purposes in the administration section. What if you don't have a GUI? There is a solution and it is quite simple.

First of all, we need to start the service Microsoft iSCSI Initiator Service and set the startup type to “Automatic”

This is done from a machine on which the Hyper-V management snap-ins are configured. Read more about this in the articles:

The setting principle is the same in both cases. After that, connect to the hypervisor via rdp and run on the command line:

Iscsicpl

The management snap-in opens iSCSI Initiator.

Then you connect the source in the standard way and work with it. To initialize a mounted disk, you must use Disk Management. You run it from the same computer on which the Hyper-V management snap-ins are installed.

Online course "DevOps practices and tools"

If you have a desire to learn how to build and maintain highly available and reliable systems, learn continuous software delivery, monitoring and logging web applications, I recommend getting to know online course “DevOps practices and tools” in OTUS. The course is not for beginners; for admission you need basic knowledge of networks and Linux installation to the virtual machine. The training lasts 5 months, after which successful course graduates will be able to undergo interviews with partners. Test yourself on the entrance test and see the program for more details.

Hello everyone, today I want to tell you how to connect an ISCSI disk from Windows Server 2008 R2 in Windows Server or regular desktop Windows. To implement this task, you must have installed an ISCSI server in Windows Server 2008 R2. Let's get down to the task at hand. The role of the computer where we will connect the iscsi disk is a server with W2012 R2. The first thing you need to find out is the iqn value of our server. To do this, you need to go to the iscsi initiator and look at it.

Right-click on Start and select Control Panel

Go to Administration

You will be warned that the ISCSI service is not running; if you want to start it automatically, click Yes.

Go to the configuration tab, where we see iscsi iqn in the initiator name field

Set the name and description

We see that you need to fill in the IQN identifier

We enter the iqn received earlier from the server where the disk will be connected.

Now you need to create an iscsi disk, then connect it to the iscsi initiator created earlier, right-click on it and select Add an existing virtual disk

Select your virtual disk, I have a 10 GB disk.

We have all connected all the components, let's go to the server where we will connect the iscsi disk and go to the initiator to the Detection tab, click the Detect portal button

Enter the IP address or DNS name of your storage server and port, by default iscsi port 3260.

All servers have been added.

Now we go to the target objects tab, we see that the disk has been identified and it is inactive, click connect.

Click ok to connect, but I advise you to look at more detailed settings

If you have multiple paths before iscsi windows server 2008 r2, then I advise you to enable support for multi-path drives

Let's see additional settings, you can specify the exact IP address of the initiator, this is if there are several of them, in fact this is necessary if you need to send traffic through it. And it will be useful to explicitly indicate the IP address of the final portal (server). Read about iscsi protection here.

Now we need to initialize the disk in Windows; to do this, go to the Disk Management snap-in.

we see that the disk is offline

We do it online

Initializing the disk

Create a simple volume

Set the size

Set the letter

Format to the desired file system

Abstract: how open-iscsi (ISCSI initiator in Linux) works, how to configure it and a little about the ISCSI protocol itself.

Lyrics: There are many articles on the Internet that explain quite well how to configure an ISCSI target, however, for some reason, there are practically no articles about working with the initiator. Despite the fact that the target is technically more complex, there is more administrative fuss with the initiator - there are more confusing concepts and not very obvious operating principles.

ISCSI

Before talking about ISCSI - a few words about different types remote access to information in modern networks.

NAS vs SAN

There are two methods of accessing data located on another computer: file (when you have remote computer they request a file, but no one cares what file systems are used to do this), typical representatives of NFS, CIFS (SMB); and block - when blocks from disk media are requested from a remote computer (similar to how they are read from hard drive). In this case, the requesting party creates a file system for itself on the block device, and the server giving the block device does not know about file systems on it. The first method is called NAS (network attached storage), and the second is called SAN (storage area network). The names generally indicate different signs (SAN implies a dedicated network to storage), but it so happens that NAS are files, and SAN are block devices over a network. And although everyone (?) understands that these are incorrect names, the further they go, the more they become fixed.

scsi over tcp

One of the protocols for accessing block devices is iscsi. The letter "i" in the name does not refer to Apple products, but to Internet Explorer. At its core it is "scsi over tcp". The SCSI protocol itself (without the letter "i") is a very complex design, since it can work through different physical media (for example, UWSCSI - parallel bus, SAS - serial - but they have the same protocol). This protocol allows you to do much more than just “connect disks to the computer” (as was invented in SATA), for example, it supports device names, the presence of several links between a block device and a consumer, switching support (yup, a SAS switch, even such exists in nature), connecting several consumers to one block device, etc. In other words, this protocol was simply being asked to be the basis for a network block device.

Terminology

The following terms are accepted in the SCSI world:
target- the one who provides the block device. The closest analogue from the ordinary computer world is a server.
initiator- client, the one who uses the block device. Client analogue.
WWID- unique device identifier, its name. Analogous to a DNS name.
LUN- the number of the “piece” of the disk being accessed. The closest analogue is a partition on a hard drive.

ISCSI brings the following changes: WWID disappears, and in its place comes the concept of IQN (iSCSI Qualified Name) - that is, a pure name, confusingly similar to DNS (with minor differences). Here is an example of an IQN: iqn.2011-09.test:name.

IETD and open-iscsi (server and client for Linux) bring another very important concept that is most often not written about in iscsi manuals - portal. Portal is, roughly speaking, several targets that are advertised by one server. There is no analogy with www, but if a web server could be asked to list all its virtualhosts, then this would be it. portal specifies a list of targets and available IPs that can be accessed (yes, iscsi supports multiple routes from initiator to target).

target

The article is not about target, so I give it a very brief description what target does. He takes a block device, slaps a name and LUN on it and publishes it on his portal, after which he allows everyone (authorization according to taste) to access it.

Here is an example of a simple configuration file, I think it will make it clear what target does (configuration file using IET as an example):

Target iqn.2011-09.example:data IncomingUser username Pa$$w0rd Lun 0 Path=/dev/md1

(complex from simple differs only in export options). Thus, if we have a target, then we want to connect it. And here things get complicated, because the initiator has its own logic, it is not at all similar to the trivial mount for nfs.

Initiator

Open-iscsi is used as the initiator. So, the most important thing is that he has operating modes And state. If we give a command in the wrong mode or do not take into account the state, the result will be extremely discouraging.

So, operating modes:

  • Search for targets (discovery)
  • Connecting to target
  • Working with a connected target
From this list it is quite clear life cycle- first find, then connect, then disconnect, then connect again. Open-iscsi keeps the session open even if the block device is not in use. Moreover, it keeps the session open (up to certain limits, of course), even if the server is rebooted. An iscsi session is not the same as an open TCP connection; iscsi can transparently reconnect to the target. Disconnecting/connecting are operations that are controlled “from the outside” (either from other software or by hand).

A little about the condition. After discovery open-iscsi remembers all found targets (they are stored in /etc/iscsi/), in other words, discovery is a constant operation, NOT at all corresponding to, for example, dns resolving). Found targets can be deleted manually (by the way, a common mistake is when open-iscsi , as a result of experiments and configuration, a bunch of found targets, when trying to log in, many errors creep into them due to the fact that half of the targets are old config lines that no longer exist on the server for a long time, but are remembered by open-iscsi) Moreover, open-iscsi allows you to change the settings of the remembered target - and this “memory” affects further work with the targets even after rebooting/restarting the daemon.

Block device

The second question that bothers many at first is where does it go after connecting? open-iscsi creates, although it is a network device, but a BLOCK SCSI class device (it’s not for nothing that it is “I say”), that is, it receives a letter in the /dev/sd family, for example, /dev/sdc. The first free letter is used, because for the rest of the system this block device is typical hard drive, no different from connected via usb-sata or simply directly to sata.

This often causes panic of “how can I find out the block device name?” It appears in the verbose output of iscsiadm (# iscsiadm -m session -P 3).

Authorization

Unlike SAS/UWSCSI, ISCSI is available for anyone to connect to. To protect against such, there is a login and password (chap), and their transfer to iscsiadm is another headache for novice users. It can be done in two ways - changing the properties of the previously found target and writing the login/password in the configuration file open-iscsi.
The reason for such difficulties is that the password and login process are not attributes of the user, but of the system. ISCSI is a cheap version of the FC infrastructure, and the concept of “user” in the context of a person at the keyboard does not apply here. If your sql database is on an iscsi block device, then of course you will want the sql server to start on its own, and not after a minute of personal attention from the operator.

Configuration file

This is very important file, because in addition to the login/password, it also describes the behavior of open-iscsi when finding errors. It may not return the error immediately, but after a certain pause (for example, about five minutes, which is enough to reboot the server with the data). It also controls the login process (how many times to try, how long to wait between attempts) and any fine tuning of the work process itself. Note that these parameters are quite important for operation and you need to understand how your iscsi will behave if you remove the power cord for 10-20 seconds, for example.

Quick reference

I don’t really like to quote easily found mana and lines, so I’ll quote typical scenario uses of iscsi:

First we find the targets we need, for this we must know the IP/dns name of the initiator: iscsiadm -m discovery -t st -p 192.168.0.1 -t st is the send targets command.

Iscsiadm -m node (list of found for login)
iscsiadm -m node -l -T iqn.2011-09.example:data (log in, that is, connect and create a block device).
iscsiadm -m session (list what you connected to)
iscsiadm -m session -P3 (print the same, but in more detail - at the very end of the output there will be an indication of which block device belongs to which target).
iscsiadm - m session -u -T iqn.2011-09.example:data (log out of a specific one)
iscsiadm -m node -l (log in to all detected targets)
iscsiadm -m node -u (log out of all targets)
iscsiadm -m node --op delete -T iqn.2011-09.example:data (remove target from detected ones).

mulitpath

Another issue that is important in serious decisions is support for multiple routes to the source. The beauty of iscsi is in the use of a regular IP, which can be processed in the usual way, like any other traffic (although in practice it is usually not routed, but only switched - the load there is too great). So, iscsi supports multipath in the “do not resist” mode. By itself, open-iscsi cannot connect to several IPs of one target. If it is connected to several IPs of one target, this will lead to the appearance of several block devices.

However, there is a solution - multipathd, which finds disks with the same identifier and processes them as expected in multipath, with customizable policies. This article is not about multipath, so I won’t explain the mystery of the process in detail, however, here are some important points:

  1. When using multipath, you should set small timeouts - switching between faulty paths should happen quickly enough
  2. In conditions of a more or less fast channel (10G and higher, in many cases gigabit), load parallelism should be avoided, since the ability to use bio coalesing is lost, which in some types of load can have an unpleasant impact on the target.

We continue to disassemble operating system Windows 10. Today we will talk about the iSCSI initiator function on Windows computer 10. iSCSI is a data transfer protocol that is designed to interoperate and manage storage systems, servers and clients. To launch iSCSI Initiator on your computer, click the Start button in the lower left corner of the screen. In the window that opens, click on the tab - All applications.

In the list of all applications, at the very bottom, click on the tab - Administration Tools. In the list that opens, click on the tab - iSCSI Initiator.

Next, in the pop-up window, click on the YES button, after which a window will open where you can create a quick connection. In the Object field, enter the IP address or DNS name of the end object with which you want to establish a connection and click on the button – Quick connection. A little lower in the field the name of the object and its state should be displayed.

Connection possible using additional parameters. If you want to completely disable an Object, then highlight the name of the object and click on the button – Abort or Disable. You can work with object properties and session configuration. To configure devices associated with a target object, select the object and click on the button – Devices.

Hello everyone, today I’ll tell you how to install an ISCSI server in Windows Server 2008 R2. Default this service is not included with Windows Server 2008 R2 and is downloaded separately as a component. The ISCSI server itself consists of iscsi target windows, which will act as a target to whom the built-in Windows component iscsi initiator, and they will be used to configure iSCSI storage.

Let me remind you what the ISCSI protocol (Internet Small Computer System Interface) is - a protocol that is based on TCP/IP and is designed to establish interaction and manage data storage systems, servers and clients. iSCSI describes: A transport protocol for SCSI that runs on top of TCP. Thanks to it you can create disk storage using Windows and connect it via your local ethernet network, the speed will of course depend more on your network park, but you won’t have to spend money on expensive FC switches, and if you have 10 or more gigabit ISCSI switches, then in general everything will be great, since they are already FCs have little to lose, plus they are easier to implement into existing infrastructure.

In order for our iscsi server to work, download Microsoft iSCSI Software Target 3.3. Launch the downloaded distribution

Using browse, we indicate where we want to upload the installation file

We see Microsoft iSCSI Software Target 3.3 has been successfully extracted.

Go to the directory where the files were extracted, we will be interested in the x64 folder, run iscsitaget_public

The installation wizard will open, click next.

We agree to the license agreement

If desired, you can change the installation directory

installation will begin


Close