Showing posts with label ESXI. Show all posts
Showing posts with label ESXI. Show all posts

Thursday, 14 July 2016

Automating configuration of a scratch location with PowerCLI

Quite often the modern ESXi servers come with no local storage and ESXi is normally installed on SD card.

As per VMware KB1033696 the SD card can't be used to store scratch partition. The main purpose of the scratch partition is to store logging files and to provide space for vm-support output.

So, the normal practice is to use shared storage (VMFS/NFS) as a scratch location. The problem is that the configuration of the scratch location is not automated in the existing vSphere. So you have to manually create folder for each of the ESXi host and configure each ESXi host to use that folder.
This can be quite time-consuming and boring tasks when you have to do it for hundred of servers.
To make things worse Host Profiles do not let you configure scratch location too.

I had some time last week and thought it was a good chance to have fun with PowerCLI and automate the scratch configuration for ESXi hosts.

So here is overview of what the script does:

  1. Connects to vCenter
  2. Collects the list of ESXi hosts in the cluster. Very often storage is not shared across multiple compute clusters so I decided to use cluster, not a datacenter, as a configuration target.
  3. Checks if there is a designated scratch folder for each of the clusters and creates if it doesn't exist
  4. Checks if the ESXi host configured with scratch location and if it points to the right datastore and folder.
  5. If ESXi is not configured yet or points to the wrong directory the correct setting will be applied.
  6. Provides a list of the ESXi servers to be rebooted for the configuration change to take effect

There are a couple of thing you have to do before running the script:
  • Identify the datastore to be used to store scratch folders
  • In that datastore create a folder where the script will create a scratch folder per each host 

 The syntax is as following:

.\scratch.ps1 -vCenter vCenter_Name -cluster Cluster_Name -datastore Datastore_Name -folder Folder_Name
for example

.\scratch.ps1 -vCenter lab-vc-01.lab.local -cluster HA -datastore ISO -folder Scratch
* I had to add folder as input parameter because I couldn't make the script land into the correct folder with New-PSdrive commandlet

You can go even further by taking advantage of Windows Task Scheduler to run this script on a daily basis to ensure all servers are consistently configured.

Let me know how it worked for you.

Friday, 8 July 2016

vSphere Distributed Switch and Nexus 1000v comparison


Choosing between VMware and Cisco virtual switch products is not an easy tasks as it includes not only side-by-side feature comparison, but also numerous aspects of duty separations, operational overhead, current skill set and expertise. And not all of them can be compared directly. 

Apart from all that it can be simply a political decision to a question "Who is going to manage virtual networks?". 

In this article I am trying to provide essential information on things to help you make the right decision for your infrastructure.

Saturday, 28 May 2016

NUMA and Cluster-On-Die

NUMA implementation has gone through several phases of Development in vSphere. At first, it was only responsible for initial placement of VMs, then its functionality was extended with dynamic balancing. In vSphere 5 VMware has presented support of Wide-VMs by exposing NUMA architecture to virtual machines.

New CPUs have presented additional feature - Cluster-on-Die - of splitting physical CPU sockets into  NUMA domains. 

The Full article can be read here

Tuesday, 5 April 2016

StarWind Virtual SAN review - Part 7 - Final Thoughts

I spent a quite interesting couple of weeks with StarWind product. Once you know it better you can definitely see how flexible this product is and how many scenarios it perfectly fits in. Given the fact that it has very low system requirements, e.g. you can run it without RAID array and you can use second-hand servers, StarWind Virtual SAN becomes a really tempting choice. 

Even though StarWind aims its product at SMB/ROBO segment of the market it still delivers great performance and high availability for your storage. Moreover, StarWind R&D constantly brings in new features and are pretty open to Virtual SAN community suggestions.

There are some new features and improvements that will be brought in future builds according to the roadmap:
  • Node majority for StarWind HA. Using node majority instead of heartbeat channels to solve potential split-brain issues in storage cluster. Additional data-less voting node for the case of even number of replication partners.
* hopefully, there will be a choice between both options.
  • VTL: integration with system deduplication for tape images.
  • Caching: cache statistics information in UI and cache management functionality for changing cache size and cache mode for existing device.
* that is one of the feature I lacked while running performance tests.
  • Global deduplication: shared deduplication base for multiple LSFS devices.
* I assume it will increase deduplication ratio and at the same time will decrease RAM allocation for hash tables
  • LSFS extend device functionality. Change size of existing LSFS device.
  • LSFS device maximum size is to be increased to 64TB


On top of that I would really like to see the following functionality:
  • be able to change cache size on the fly and some kind of built-in health checks.
  • It would be also great to get some kind of dashboard that will show current alerts - e.g. failed Sync link; potential issues - e.g. low disk space; performance stats - e.g. disk latency, IO size. 
  • Shorter LSFS mounting time
  • Simultaneous resync for multiple devices. Currently only one device can be re-synced at a time after partner node’s reboot. 

And my biggest wish is that StarWind get all their documentation updated to the latest builds. It would be also  great to have a cookbook which deep-dives into technical explanation of all great features the product and describes the most common deployment scenarios. 

StarWind Virtual SAN is a permanent tenant in my home lab now and I will definitely be tracking the progress of this product in future versions.

StarWind Virtual SAN review- Part 6 - Failure Scenarios

In this part of the review I would like to talk about some possible failure scenarios and how StarWind Virtual SAN reacts to them.

1. Heartbeat link failure

It causes no impact on the functionality for the simple reason that heartbeat link is used in case of Sync link failure only. If it is caused by failure on ESXi level or failure of the physical switch make sure you have those properly monitored.

2. Sinlge Sync link failure


ESXi hosts will still see all your targets, but storage performance may decrease because the surviving SYNC interface's bandwidth won't be able to cope with the amount of SYNC traffic.

3. All Sync links failure. 

When SW Servers can't reach each other over Sync links they will use Heartbeat link to identify whether its partner server is online or offline:

a. Online - Secondary device will disable access to all devices. Primary device will flush the cache to the disks (if you have large cache that can cause temporary disk contention) and the cache will be switched into write-through mode to ensure the integrity of the data if primary SW node fails too. All nodes will fail over storage pathes to the primary SW appliance. Once the sync link is restored you SW will resync HA devices.

b. Offline. The server will declare himself a master.

4. Sync and Heartbeat Link Failure

This is the worst case scenario when both nodes believe they are the only survivor. Data get unsynced and can be considered as corrupted, and the data restore is the only option in this situation. Therefore, don't hesitate to have more than 1 heartbeat link. Heartbeat interface doesn't generate much traffic and can co-exist with other traffic types without any significant impact. 

5. Disk Failure

a. RAID0 - SW loses access to the device. All paths will be switched to the other node. 

b. RAID1,5,6 - there will be performance decrease as your raid arrays will have to handle RAID rebuild load while servicing other IOs.
`
6. SSD hosting L2 cache failure

If L2 cache was set to to Write-Through mode the Virual SAN device goes offline on the given server, but its replica stays online on the partner node. To bring it back online you will need to disable L2 cache and to restart StarWind Virtual SAN service. That will make device active and will resume syncing with partner device.

7. SW Server/ESXi host failure


StarWind Virtual SAN review - Part 5 - Performance tests

In this part of StarWind Virtual SAN review I will be testing and comparing performance of different disk types using different combination of features. But let me first start with a short description of my test bed.
  • 2 x ESXi servers with Avoton CPUs - C2750DI4
  • Each ESXI host has: 
    • 1 x 7.2 HDD 
    • 1 x 256GB SSD. 
    • 6 x 1GB NICs. All NICs are connected to a single TP-Link switch.
  • First pair of NICs on each host is used for management and VMs traffic, another pair is dedicated for iSCSI traffic to Synology box and the last two NICs are reserved for StarWind servers. 
  • All VMs, including StarWind Virtual SAN Servers, run on a shared iSCSI storage (Synology). 
  • Each ESXi server hosts one StarWind Virtual SAN and has two local VMFS datastores - created on HDD and SSD disks
  • The test disks, attached to Virtual SAN servers are placed on local HDD (data) and SSD (L2 cache). Thus, there is no other workload present on test disks.
  • Each Virtual SAN server has two additional disks - one per each local datastore. That's where the test disks and corresponding Level 2 cache files are created. 

There is another important thing to mention before you get to the test results. I don't have any intention to provide test results that could be valid for real-life scenarios for the simple reason that my Lab setup doesn't meet the minimum hardware requirements for StarWind, e.g. Intel Xeon E5620 (or higher) CPU. 

My idea was to compare different combination of disks and features and to see how each feature contributes to performance. For instances, I was curious to check how many times Flat disk with L1 and L2 caches is faster than regular disk, or how HA Disks' performance depends on the multipathing policy. 

Here is all all combinations I wanted to test summed up in one table
StarWind Tests Config



The plan was to get the baseline performance running IOmeter natively in StarWind so that I could compare it with the productivity of the Virtual SAN disks running on top of StarWind server and its overhead.

Then I created 11 different StarWind devices as per the table above and presented them to the ESXI hosts. I have also adjusted the number of IOPs to 1 before ESXi hosts switch the path to Virtual SAN servers as per VMware KB2069356. That means each host will be talking to both Virtual SAN appliances (the local and the remote ones) when StarWind device is mirrored to another appliance.

Then I have created a Test VM with 11 disks placed on corresponding Virtual SAN datastores.


That's the final picture of my datastores

And that's how the disks in Test VM look like




I hope you get the idea of the test setup now.

IOmeter was chosen as a test tool, however, it was taking IOmeter too long to create test file so I used RDFC (Random DataFile creator) utility to create test files.

Here is the IOmeter test specification: 

  • 20GB Test File 
  • 4KB Block size
  • 32 outstanding IOPs 
  • 100% Random, 67% Reads, 33% Writes, 
  • Duration 2 minutes.

The table below depicts the final test results using Round Robin multipathing




Now let’s talk about performance results with regard to each disk type.  

Flat

As you can see Flat device result is very close to the baseline result. That means the overhead of StarWind is minimal and can easily be neglected.

Flat-HA

Here you can see benefit of Read Striping when ESXi hosts take advantage of all disk spindles in both ESXi servers (387 vs 287). However, this positive effect applies to Reads only. If you have Write intensive applications, it is better to use Fixed multipathing policy.

Here is a nice article which also proves benefits of mutlipathing on StarWind

Flat-L1

L1 cache proved to be pretty helpful as it lets Virtual SAN servers deal with IO bursts. During the IOmeter test Virtual SAN cached all Writes in RAM while HDD served Reads only. Once the test was stopped I could see Virtual SAN de-staging all Writes onto HDD.

Here is how it looks in the performance graph



Flat-L1-HA

This disk config reflects further performance improvement, again due to Read Striping across both hosts.

While testing this particular disk type I found out how important it is for StarWind product to have the correct IOPS limit for Round Robin policy.

At first run I have default 1000 IOPS limit and what I noticed that both hosts didn’t seem to cache any writes. As soon as IOmeter started I could see that both Virtual SAN servers started to push writes to HDD. It looked like L1 cache wasn't utilised at all. 
This didn’t happen in previous scenario with standalone Flat-L1. However, when I changed IOPS limit to 1 the caching started to work again.

Here is what, I believe, happens with IOPS limit set to default value of 1000.
  • ESXi host sends 1000 IOs over the first path to the first Virtual SAN server.
  • Writes are stored in L1 cache. Reads are serviced from HDD.
  • ESXi host send another 1000 reads and writes over the second path to the second Virtual SAN server
  • While second Virtual SAN processes these IOs the first StarWind server thinks that workload is dropped to zero and starts de-staging data stored in RAM.
  • When ESXi host switches back to the first iSCSI path the second StarWind server starts dumping cache data on the HDD as well.

So you end up with the situation when both Virtual SAN servers have plenty of cache to accommodate gigabytes of Write IOs, but StarWind doesn’t take much advantage of it since it keeps data in the cache for very short period of time and constantly flushes the cache data to HDD, thus, impacting Read performance.

Therefore, with IOPS=1000 I was getting around 310 IOPS in IOmeter, but once IOPS limit was changed to 1 the performance jumped up to 600.


Flat-L1-L2

Even though the results are pretty good we can see that the presence of L2 cache didn't improve results as much as I expected. I had a chat with StarWind engineers and I was told L2 caching algorithm is going to be improved in the next build. Also, it ought to be noted that my test runs were pretty short to get enough data cached in L2 and to get significant advantage of it.

Flat-L1-L2-HA

Another example of benefits of Read Striping with Round Robin multipathing. Also, if you compare this result with Flat-L1-HA you can see that L2 cache hasn’t been useful at all. Again, let’s wait for a newer build and hope SSD commodity disks contribute more into overall performance.

LSFS

LSFS shows serious increase in performance compared to Flat disk -  341 vs 287. This difference is valid only for this particular test configuration. As it was mentioned before LSFS is pretty good in dealing with Random Writes, but it isn't efficient for Sequential Reads, for instance.

LSFS-HA

No surprises here. The result is almost doubled compared to standalone LSFS (341 vs 654) due to double number of Virtual SAN servers and physical disks servicing IOmeter.

LSFS-DD

Deduplication increases performance of the LSFS even further (359 vs 341). This happens because LSFS computes each data block's hash on the fly and will compare it with hash table stored in RAM. If this data already exists on the LSFS disk Virtual SAN will only have to update metadata table without writing actual data which can save some Write IOPs.

Deduplication applies to cache data too, which means more data can be stored in cache, thus, increasing cache hits ratio.

LSFS-DD-HA

Again, the performance is almost doubled by using Round Robin - 359 vs 690 IOPS.

LSFS-DD-L1-L2-HA

That's the final test scenario where I wanted to see how Virtual SAN behaves with all bells and whistles enabled. As you can see I could get amazing result of 740 IOPS on my very humble test hardware with data being mirrored between two 7.2K HDDs only while keeping latency under 50ms.

I have also tested the HA enabled devices in Fixed mode just to see what kind of performance I get if I blindly follow best practices documentation. 

I merged both - RR and Fixed - results into one table just to see what gives me the best results in my particular configuration




As you can see in all configurations the Round Robin multipathing was outperforming Fixed PSP. So, I need StarWind need to review and update their Best Practices documentation that says Fixed PSP is the only supported configuration on ESXi hosts. 





I know there are more device combinations and more combinations of IOmeter specifications to try, but I have that much of time on these tests. If there is interest in more test combinations and on different hardware I might write another post on this.

Again, I would like to stress out that these test results are given here for the sake of comparison of features and disk types. The test system does not meet the minimal system requirements and therefore test results are valid only for this particaluar setup. 




StarWind Virtual SAN review - Part 4 - Installation Guide Notes

The installation procedure is pretty much described in the official document, and for most of you it should be sufficient to get it StarWind up and running, but I would like to mention some important things that are not covered in the guide:

1. If you want to save some money on network cards you can use the same NICs in Virtual SAN server for Sync and iSCSI link. There is no need to spllt them into different VLAN. All you have to do is to assign secondary IP Addresses to the interfaces. For instance, NiC called 'Sync/iSCSI Interface' will have 192.168.100.11 for iSCSI traffic and 172.16.1.11 for Sync traffic.

2. Set the correct PSP. According to the Best Practices document it has to be Fixed for Virtual SAN server running on ESXi host. Make sure you select the correct preferred path to the local StarWind server to minimize the storage latency. 

If the bigger part of workload is Sequential or Random Reads you may want to consider using Round Robin PSP to benefit from Read striping across both Virtual SAN servers.

3. Don't forget to Enable Jumbo Frames, but make sure you test performance before and after enabling this feature. There are rare cases when Jumbo Frames can lead to performance deterioration.

4. Make sure you properly test automatic storage rescan triggered by StarWind servers upon restart. That will ensure that ESXi server detects all datastores after reboot and manages to power on your VMs.

5. Configure and test Virtual SAN server to send all critical alerts so you don’t miss anything important, e.g. link failure or device going unsync.

6. If you chose to use Round Robing PSP I strongly recommend to change Default Round Robin limit from 1000 to 1 as per VMware KB2069356. I will explain why it is so important in Part 5.



I have also spotted that along with standard deployment options of StarWind which are described in great details by Vladan Segret (1, 2, 3) there is another interesting deployment option which actually built-in Virtual SAN management console. 

What it does is it builds Virtual Storage Appliance image using combination of free Windows Hyper-V Core Server image and StarWind software. 

The simple wizard guides you through several steps helping you to choose ESXi host and datastore where VSA will be deployed, the network to connect VSA management interface to, etc.


This choice can be useful, for instance, in Linux centic environments where system administrators don't deal much with Windows servers or when running free ESXi servers and not being able to deploy Windows VM from a template. It is not a killer feature for sure and it definitely could be improved to minimise the number of post-deployment configuration steps, but it is a useful addition to deployment options.




StarWind Virtual SAN review - Part 3 - Disk and Cache types


StarWind delivers Virtual SAN with two main device types: Flat and LSFS.

Flat device is basically a thick-provisioned image file placed on one of the disks in Virtual SAN server, which can be presented as iSCSI target. A Flat device does its job with minimal overhead and proved to be a reliable no-frills choice. You can run it in a standalone or HA configuration.
In previous versions of StarWind Virtual SAN it used to be the only device option until StarWind introduced LSFS.

LSFS stands for Log Structured File System. According to Wiki "LSFS is a file system in which data and metadata are written sequentially to a circular buffer, called a log". It is quite efficient solution when you run virtualized workload on top of it, but in some scenarios it can behave not as good as you would expect it. More on it below.

* For those of you who has never heard about LSFS (WAFL ,CASL) here is a very short description of how it works.

All new writes in LSFS go to new space, or new log file. For instance, If VM tries to overwrite, let's say, Block A the LSFS device will not alter existing Block A, but will write the data to the new log file and will update the pointer to the Block A in the metadata table. The old block A becomes invalid and will be cleaned up during garbage collection process.

Along with invalid Block A the LSFS log file may contain Block B which is still actual as it was left intact. When garbage collection runs it will move valid blocks of data to new space and will delete the invalid blocks. So there is expected performance impact during the garbage collection and you must be aware of it.

So let’s start with the perks you get with LSFS:

1. LSFS is awesome for workload with multiple random small writes, and therefore, it is ideal for virtual workloads which deliver mostly blended stream of random IOs. To improve Writing performance it caches all Writes in RAM, re-orders and merges them into one big chunk of data and pushes data to hard drives as sequential Write IOs. Even regular 7.2K HDD can thousands of sequential Writes.

The following pic conveys the whole idea of LSFS. 





StarWind claims that LSFS on RAID5 on 3 x HDDs performs faster than local datastore on RAID10 on 6 x HDDs. However, if you have mostly sequential IOs it may be preferable to use Flat images, although in a virtualised environment you get Random IOs most of the time. Here is a nice White Paper with more details on this feature

2. LSFS eliminates the RAID5/6 write penalty since LSFS doesn't need to go through Read-Modify-Write cycle as it writes full stripes on your RAID. This applies, for instance, to scenarios with separated Compute & Storage layers where StarWind is installed natively on Windows or when Virtual This can also apply to Hyperconverged scenarios with Vmware as StarWind can either align its writes or take ownership of a raw device and set its own block parameters. Btw, by default the local storage cannot be presented as RDM device - see VMware KB1017530


3. Thin Provisioning. 

Not much to explain here, but I have to mention that it is default feature for LSFS and it cannot be disabled.

4. Inline Deduplication.

Hash-tables of all data blocks are stored in RAM. Before writing new data block to LSFS disk Virtual SAN server computes its hash and compares it with hash table. If match is found only metadata is updated creating a pointer to matching data block on the disk . Since all operations are done in RAM it doesn't incur much performance overhead and in general decreases number of actual Writes to disks. Interestingly, once deduplication is enabled it also deduplicates L1 cache, thus, letting you store significantly more data in RAM to serve IOs faster.

5. It is flash-friendly as it reduces the number of re-writes and extends the lifespan of all flash array.


There are some important things to keep in mind when you plan to use LSFS:

  • Under heavy random write small block (4-16K) workload LSFS can use up to 2.5-3 times of space compared to the LSFS device size. So if you provide, for instance, 1TB LSFS disk you may need to place LSFS device on 2.5TB disk in Virtual SAN server. This is natural feature of all Log structured files systems as it can take some time before old data is cleaned up during the garbage collection process. If the disk hosting LSFS device runs out of free space the LSFS device will convert into RO mode.
  • Be aware that LSFS device cannot be extended and its maximum size is limited by 11TB. However, it is not recommended to create that big SW device anyway due to operational overhead - it takes longer to re-sync such devices in HA configuration and backup/restore time is increased as well. This limit will be increased to 64TB in the next 3-4 months according to StarWind Virtual SAN roadmap
  • For each 1TB of LSFS disk space you need to provide 3.5GB of RAM to accommodate random Writes before they are re-ordered in sequential Writes.
  • When Virtual SAN is installed natively on physical Windows server only Hardware RAID controllers are supported for now. So please get a descent RAID controller instead of running Windows Software RAID. According to StarWind roadmap they are bringing raw device mapping support in the future builds.
  • Performance results of sequential Reads on LSFS can be inconsistent as in LSFS format these sequential Reads turns into Random reads. That means you need to have a clear understanding what your workload consists of before you make a choice on device type
  • It can take a while to mount an LSFS device after Virtual SAN server reboot


Another substantial benefit of SW Virtual SAN compared with other storage solutions is that it gives you total control of cache type and size per each storage device. 

StarWind Virtual SAN allows you to create two types of cache:

Level 1 - this cache is created in RAM and is light-speed fast. It is recommended to use it in Write-Back mode to provide consistent performance during Write bursts. The more RAM you have the bigger cache you can create. It is all up to you budget. You can always start small and add more cache as needed later on.

Level 2 - this cache is normally stored on commodity SSD devices, though you can always go with NVMe SSDs. StarWind recommends to use in in Write-Through mode. Thus, it will speed up Read IOs only, but your SSD will serve you longer as it wears out slower in Write-Through mode. It will also offload random read IO from the underlying storage allowing it to deliver more IO for random writes.

Each disk type and each feature requires some RAM to be reserved so please check StarWind best practices and do a proper math to check the minimum RAM requirements for your Virtual SAN configuration.

* I also had a couple of chats with StarWind engineers and according to them L2 cache doesn't show its best performance yet in the latest publically available build. The new build promises to bring optimised L2 caching algorithm. Although in my performance tests L2 cache was pretty useful, even though the results of L2 cache performance boost were not consistent across all tests.