Archive

Posts Tagged ‘windows’

Windows Text Console on SmartOS

July 23rd, 2015 Comments off

With SmartOS the vmadm console command offers a convenience method for pulling up a text console for a guest VM.  This is commonly used for Linux and BSD VMs and it can be enabled for Windows VMs too.  The below steps outline how to enable and utilize this feature on Windows 2012 R2 through the use of the Windows Emergency Management Services (EMS).

Configuration

  1. As an administrator user run the following commands. If you have configured more than one boot entry you may want to tailor this command to target only a specific boot entry.  Together these enable EMS and then set it to run on COM1 at a baud rate of 115,200.
    C:\>bcdedit /ems on
    C:\>bcdedit /emssettings EMSPORT:1 EMSBAUDRATE:115200
    
  2. From the SmartOS host start up the console and substitute in the appropriate UUID of the VM from vmadm list:
    # vmadm console <uuid>
    
  3. Reboot the VM.
  4. On the console window you will see something like the following:
    Computer is booting, SAC started and initialized.                               
                                                                                    
    Use the "ch -?" command for information about using channels.                   
    Use the "?" command for general help.                                           
                                                                                    
                                                                                    
    SAC>                                                                            
    EVENT: The CMD command is now available.                                        
    SAC>
    
  5. We’re at a SAC prompt, but it’s not yet the familiar CMD.EXE.  The SAC is the Special Administration Console which has some additional functionality, one of which is to start CMD.  To do so simple run cmd and then switch to the channel that it created:
    SAC>cmd
    The Command Prompt session was successfully launched.
    EVENT:   A new channel has been created.  Use "ch -?" for channel help.
    Channel: Cmd0001
    SAC>ch -si 1
    
  6. From here press any key and then enter in the username, domain, and password when prompted and CMD prompt will then be usable as well as PowerShell by running powershell at the CMD prompt:
    Microsoft Windows [Version 6.3.9600]                                            
    (c) 2013 Microsoft Corporation. All rights reserved.                            
                                                                                    
    C:\Windows\system32>

Limitations

This does not appear to work on all versions of Windows.  When I tried with Windows 7 the bcdedit commands completed successfully but the console text never appeared.  Older versions will need to use the bootcfg command instead of bcdedit.

While functional, the serial console can be a bit sluggish at times.  Also, when using this within xterm the text scrolls at the 25 line mark rather than filling up the full terminal window.

Tags: , ,

ZFS Deduplication with NTFS

November 24th, 2009 3 comments

ZFS deduplication was recently integrated into build 128 of OpenSolaris, and while others have tested it out with normal file operations, I was curious to see how effective it would be with zvol-backed NTFS volumes.  Due to the structure of NTFS I suspected that it would work well, and the results confirmed that.

NTFS allocates space in fixed sizes, called clusters.  The default cluster size for NTFS volumes under 16 TB is 4K, but this can be explicitly set to different values when the volume is created.  For this test I stuck with the default 4K cluster size and matched the zvol block size to the cluster size to maximize the effectiveness of the deduplication.  In reality, for this test the zvol block size most likely had a negligible effect, but for normal workloads it could be considerable.

The OpenSolaris system was prepared by installing OpenSolaris build 127, installing the COMSTAR iSCSI Target, and then BFU‘ing the system to build 128.

The zpool was created with both dedup and compression enabled:

# zpool create tank c4t1d0
# zfs set dedup=on tank
# zfs set compression=on tank
# zpool list tank
NAME   SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
tank  19.9G   148K  19.9G     0%  1.00x  ONLINE  -

Next, the zvol block devices were created.  Note that the volblocksize option was explicitly set to 4K:

# zfs create tank/zvols
# zfs create -V 4G -o volblocksize=4K tank/zvols/vol1
# zfs create -V 4G -o volblocksize=4K tank/zvols/vol2
# zfs list -r tank
NAME              USED  AVAIL  REFER  MOUNTPOINT
tank             8.00G  11.6G    23K  /tank
tank/zvols       8.00G  11.6G    21K  /tank/zvols
tank/zvols/vol1     4G  15.6G    20K  -
tank/zvols/vol2     4G  15.6G    20K  -

After the zvols were created, they were shared with the COMSTAR iSCSI Target and then set up and formated as NTFS from Windows.  With only 4 MB of data on the volumes, the dedup ratio shot way up.

# zpool list tank
NAME   SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
tank  19.9G  3.88M  19.9G     0%  121.97x  ONLINE  -

The NTFS volumes were configured in Windows as disks D: and E:.  I started off by copying a 10 MB file and then a 134 MB file to D:.  The 10 MB file was used to offset the larger file from the start of the disk so that it wouldn’t be in the same location on both volumes.  As expected, the dedup ratio dropped down towards 1x as there was only a single copy of the files:

# zpool list tank
NAME   SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
tank  19.9G   133M  19.7G     0%  1.39x  ONLINE  -

The 134 MB file was then copied to E:, and immediately the dedup ratio jumped up.  So far, so good:  dedup works across multiple NTFS volumes:

# zpool list tank
NAME   SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
tank  19.9G   173M  19.7G     0%  2.26x  ONLINE  -

A second copy of the 134 MB file was copied to E: to test dedup between files on the same NTFS volume.  As expected, the dedup ratio jumped back up to around 3x:

# zpool list tank
NAME   SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
tank  19.9G   184M  19.7G     0%  3.19x  ONLINE  -

Though simple, these tests showed that ZFS deduplication performed well, and it conserved disk space within a single NTFS volume and also across multiple volumes in the same ZFS pool.  The dedup ratios were even a bit higher than expected which suggests that quite a bit of the NTFS metadata, at least initially, was deduplicated.