Wednesday, 24 June 2015

Renaming a Cluster and Vserver (SVM) which has Existing Peers

Renaming the Cluster is easy and disruptive to nothing:

OLD::> hostname CLU
Are you sure you want to rename the cluster? {y|n}: y
Info: The cluster name has been changed to CLU.
CLU::>

Renaming the Vserver with existing Vserver peers in place isn’t so easy (hence this blog post):

CLU::> vserver rename -vserver OLDSVM -newname SVM
Error: command failed: Cannot rename a Vserver that is part of inter cluster Vserver peer relationship. Delete the Vserver peer relationship to proceed.
CLU::>

As instructed, delete the vserver peer relationship:

CLU::> vserver peer show -vserver OLDSVM
CLU::> vserver peer delete -vserver OLDSVM -peer-vserver SRCSVM
Error: command failed: Relationship is in use by SnapMirror in local cluster. Use the "snapmirror delete" command to delete the application, then retry the command.
CLU::>

As instructed, delete all the snapmirrors (first recording the details of them):

CLU::> rows 0
CLU::> snapmirror show -source-vserver SRCSVM -destination-vserver OLDSVM -instance
CLU::> snapmirror show -source-vserver SRCSVM -destination-vserver OLDSVM -fields source-path,destination-path,policy,schedule,type
CLU::> snapmirror delete -source-vserver SRCSVM -destination-vserver OLDSVM -destination-volume *
CLU::>

And go onto the source cluster and release all the SnapMirrors:

SRC::> snapmirror release -source-vserver SRCSVM -destination-vserver OLDSVM -destination-volume *

Then delete the vserver peer relationship:

CLU::> vserver peer delete -vserver OLDSVM -peer-vserver SRCSVM

Then rename the SVM:

CLU::> vserver rename -vserver OLDSVM -newname SVM

Then recreate the vserver peer relationship:

CLU::> vserver peer create -vserver SVM -peer-vserver SRCSVM -peer-cluster SRC -applications snapmirror

And go onto the source cluster to complete the peer relation:

SRC::> vserver peer accept -vserver SRCSVM -peer-vserver SVM

The recreate all the SnapMirror relationships and resync:

CLU::> snapmirror create -source-vserver SRCSVM -source-volume {SRCVOL1} -destination-vserver OLDSVM -destination-volume {VOLUMENAME1} -type {TYPE} -schedule {SCHEDULE} -policy {POLICY}

CLU::> snapmirror create -source-vserver SRCSVM -source-volume {SRCVOL2} -destination-vserver OLDSVM -destination-volume {VOLUMENAME2} -type {TYPE} -schedule {SCHEDULE} -policy {POLICY}

and on ...

CLU::> snapmirror resync -source-vserver SRCSVM -destination-vserver OLDSVM -destination-volume *

Note: The lab environment was NetApp Clustered Data ONTAP 8.2.2P1.

Tuesday, 23 June 2015

CIFS Shares Availability Checker PowerShell

I wrote this script a good half a year ago, lost it, and then found it just recently. It’s a very basic check to test "net use" access to a list of shares. Additionally (you can hash the $acls bits out if you don’t want it), we read in the corresponding ACLs too, so if we fail to connect we know what the share ACL was.

$shares = Get-Content SHARES_FILE.TXT
$acls = Get-Content ACLs_FILE.TXT

$i = 0
$shares | foreach {
       Write-Host "Testing share $_" -ForegroundColor Cyan
       & net use T: $_
       $result = $null
       $drives = (Get-PSdrive).Name
       $drives | foreach { if($_ -eq "T"){$result = $true} }
       & net use T: /delete
       If ($result){
              Write-Host "Successfully connected!" -ForegroundColor Green
       } else {
              Write-Host "Failed to connect!" -ForegroundColor Red
              Write-Host ("ACL = " + $acls[$i]) -ForegroundColor Red
       }
       $i++
}

Thursday, 18 June 2015

How to Setup Plink for (clustered) ONTAP

Walkthrough

1) Download plink.exe, pscp.exe, putty.exe, puttygen.exe from:


Image: plink.exe and associated downloads

2) Place the files in your C:\Windows folder

Image: plink.exe and associated files in C:\Windows
Note: This allows us to run the binaries from any path in DOS or PowerShell. Any path that’s specified in System Properties > Advanced > Environment Variables > System variables > Path would do. If corporate restrictions on you system prevent you using C:\Windows, or modifying the System Path, you will need to make adjustments to the content in this post.

3) A quick test from DOS (or PowerShell) :\>

plink -ssh -x -a -l admin -pw PASSWORD CLUSTER_NAME_IP "version"

{Replace PASSWORD and CLUSTER_NAME_IP}

Note: If you have not connected over SSH from the workstation to CLUSTER before, this connection will fail because the clusters RSA2 key has not been cached on the workstation. Make an initial connection with PuTTY and then try again.

4) Run puttygen to generate a public/private key pair.

i) Ensure ‘Type of key to generate’ is set to SSH-2 RSA and ‘number of bits in a generated key’ is 1024.

ii) Click Generate

Image: PuTTY Key Generator
Note: If you don’t set bits to 1024, you could get “Failed to generate Fingerprint for the publickey.”

iii) Leave the passphrase blank and save the private key to C:\Windows as something like puttygen_20150618_priv_key.ppk

iv) Leave PuTTY Key Generator open for now (or you can save the public key), since we’ll need to copy and paste that into (clustered) ONTAP

5) Create a login in (c.) ONTAP ::>

security login create -username USERNAME -application ssh -authmethod publickey -role admin

{Replace USERNAME}

6) Create a login publickey in (c.) ONTAP ::>

security login publickey create -username USERNAME -index 1 -publickey "<-copy-and-paste-here-the-public-key-from-earlier->"

Example:

CLU01::> security login publickey create -username ADMINPK -index 1 -publickey "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAs6xBkTG/zukvKrPMqdC5JW7KWiw46vlOBZYOQiJDqqOa7T6YYGnqzUsKjOrLLp5O3X5H0BkTHv5C2LEvcb49y3o3IYDvs/g361tXvRNl18FI9T5sIQFd8NEcebei9UK0NTi7wzRbpYGSQYvqgYv9Yzs+mKP/ibxZUJcEqC1iRl8= rsa-key-20150618"

7) Test it works :\>

plink -ssh -x -a -l USERNAME CLUSTER_NAME_IP -I c:\windows\puttygen_20150618_priv_key.ppk "version"

Example:

C:\>plink -ssh -x -a -l ADMINPK 192.168.168.100 -i c:\windows\puttygen_20150618_priv_k
ey.ppk "version"
NetApp Release 8.2.2P1 Cluster-Mode: Wed Oct 08 05:09:35 PDT 2014

Now you can make batch files - or something else ;-) - and run your Clustershell commands non-interactively over SSH!

Note: I use the -x and -a switches above, but it will work fine without them.

APPENDIX: Plink Switches (Plink Help Output)

Plink: command-line connection utility
Release 0.64

Usage: plink [options] [user@]host [command]
       ("host" can also be a PuTTY saved session name)

Options:

-V        print version information and exit
-pgpfp    print PGP key fingerprints and exit
-v        show verbose messages
-load sessname  Load settings from saved session
-ssh -telnet -rlogin -raw -serial
    force use of a particular protocol
-P port   connect to specified port
-l user   connect with specified username
-batch    disable all interactive prompts
-sercfg configuration-string (e.g. 19200,8,n,1,X)
    Specify the serial configuration (serial only)

The following options only apply to SSH connections:

-pw passw login with specified password
-D [listen-IP:]listen-port
    Dynamic SOCKS-based port forwarding
-L [listen-IP:]listen-port:host:port
    Forward local port to remote address
-R [listen-IP:]listen-port:host:port
    Forward remote port to local address
-X -x     enable / disable X11 forwarding
-A -a     enable / disable agent forwarding
-t -T     enable / disable pty allocation
-1 -2     force use of particular protocol version
-4 -6     force use of IPv4 or IPv6
-C        enable compression
-i key    private key file for user authentication
-noagent  disable use of Pageant
-agent    enable use of Pageant
-hostkey aa:bb:cc:...
    manually specify a host key (may be repeated)
-m file   read remote command(s) from file
-s        remote command is an SSH subsystem (SSH-2 only)
-N        don't start a shell/command (SSH-2 only)
-nc host:port

    open tunnel in place of session (SSH-2 only)

Sunday, 14 June 2015

Enhancing the Basic Setup of an ONTAP 8.3 2-Node Simulator Cluster

Okay, so we’ve done a basic 2-node ONTAP 8.3 Simulator setup as in the last post here - what next?

This is what I’m doing (below).

Note: All these commands are run from the Clustershell ::> . Mostly everything below can be done in OnCommand System Manager, with wizards, workflows and stuff (probably better than doing it via the CLI), but I’m most comfortable with the CLI hence I’ll do it my way ;-)

Modify the CLI session timeout so it doesn’t keep chucking you out every 30 minutes (and of course, this is a SIM so we don’t want the session to timeout!)

timeout modify -timeout 0
timeout show

I like to rename the nodes since hashes can’t be used everywhere. Replace CLUSTER below with your Cluster name:

node rename -node CLUSTER-01 -newname CLUSTERN1
node rename -node CLUSTER-02 -newname CLUSTERN2
node show

Assign all disks (the SIMs are not HA partners). Replace NODE1 & NODE2 below with your node names:

disk assign -all true -node NODE1
disk assign -all true -node NODE2
disk show -container-type unassigned

Rename aggregates as required:

aggr rename aggr0 -newname NODE1_ROOT
aggr rename aggr0_CLUSTER_02_0 -newname NODE2_ROOT
aggr show

Expand the root aggregates - I increase the ROOT aggr from 3 to 7 disks since vol0 has a habit of running out of space on the SIM with its default tiny 1GB size disks, and we make vol0 bigger next!:

aggr add-disks -aggregate NODE1_ROOT -diskcount 4
aggr add-disks -aggregate NODE2_ROOT -diskcount 4
aggr show

I increase vol0 to 75% the size of the ROOT aggr - 75% because over 75% generates aggr low space alerts in some OnCommand softwares:

vol size vol0 -vserver NODE1 -new-size 3202M
vol size vol0 -vserver NODE2 -new-size 3202M
vol show vol0

Disable snapshots on the node root vol - vol0 - and delete any snaps since this is a SIM with limited capacity:

node run -node * snap sched vol0 0 0 0
node run -node * snap sched vol0
node run -node * snap delete -a -f vol0
snap list vol0

Disable snapshots on the root aggregates and delete any snaps:

node run -node NODE1 snap sched -A NODE1_ROOT 0 0 0
node run -node NODE2 snap sched -A NODE2_ROOT 0 0 0
node run -node * snap sched -A
node run -node NODE1 snap delete -a -A -f NODE1_ROOT
node run -node NODE2 snap delete -a -A -f NODE2_ROOT
node run -node * snap list -A

Verify the timezone is correct and set if required (e.g. to Europe/London):

timezone

Verify the date and set if required (e.g. date HHMM):

date

Set Cluster-scoped NTP servers:

cluster time-service ntp server create NTP_SERVER_IP_1
cluster time-service ntp server create NTP_SERVER_IP_2
cluster time-service ntp server show

Disable AutoSupport since this is a SIM!:

autosupport modify -node * -state disable

Add Simulator licenses for Node 1 (Note: The real SIM license codes are replaced by X’s below):

system license add XXXXXXXXXXXXXXXXXXXXXXXXXXXX # CIFS protocol
system license add XXXXXXXXXXXXXXXXXXXXXXXXXXXX # Fibre Channel Protocol
system license add XXXXXXXXXXXXXXXXXXXXXXXXXXXX # FlexClone
system license add XXXXXXXXXXXXXXXXXXXXXXXXXXXX # OnCommand Insight and Balance products
system license add XXXXXXXXXXXXXXXXXXXXXXXXXXXX # iSCSI protocol
system license add XXXXXXXXXXXXXXXXXXXXXXXXXXXX # NFS protocol
system license add XXXXXXXXXXXXXXXXXXXXXXXXXXXX # SnapLock Compliance
system license add XXXXXXXXXXXXXXXXXXXXXXXXXXXX # SnapLock Enterprise
system license add XXXXXXXXXXXXXXXXXXXXXXXXXXXX # SnapManager and SnapDrive products
system license add XXXXXXXXXXXXXXXXXXXXXXXXXXXX # SnapMirror, including synchronous SnapMirror
system license add XXXXXXXXXXXXXXXXXXXXXXXXXXXX # SnapProtect Applications
system license add XXXXXXXXXXXXXXXXXXXXXXXXXXXX # SnapRestore
system license add XXXXXXXXXXXXXXXXXXXXXXXXXXXX # SnapVault primary and secondary

Add Simulator licenses for Node 2 (Note: The real SIM license codes are replaced by Y’s below):

system license add YYYYYYYYYYYYYYYYYYYYYYYYYYYY # CIFS protocol
system license add YYYYYYYYYYYYYYYYYYYYYYYYYYYY # Fibre Channel Protocol
system license add YYYYYYYYYYYYYYYYYYYYYYYYYYYY # FlexClone
system license add YYYYYYYYYYYYYYYYYYYYYYYYYYYY # OnCommand Insight and Balance products
system license add YYYYYYYYYYYYYYYYYYYYYYYYYYYY # iSCSI protocol
system license add YYYYYYYYYYYYYYYYYYYYYYYYYYYY # NFS protocol
system license add YYYYYYYYYYYYYYYYYYYYYYYYYYYY # SnapLock Compliance
system license add YYYYYYYYYYYYYYYYYYYYYYYYYYYY # SnapLock Enterprise
system license add YYYYYYYYYYYYYYYYYYYYYYYYYYYY # SnapManager and SnapDrive products
system license add YYYYYYYYYYYYYYYYYYYYYYYYYYYY # SnapMirror, including synchronous SnapMirror
system license add YYYYYYYYYYYYYYYYYYYYYYYYYYYY # SnapProtect Applications
system license add YYYYYYYYYYYYYYYYYYYYYYYYYYYY # SnapRestore
system license add YYYYYYYYYYYYYYYYYYYYYYYYYYYY # SnapVault primary and secondary

And verify the licenses:

system license show

Create an Intercluster LIF per node for later SnapMirror purposes:

net int create -vserver CLUSTER -lif rep1 -role intercluster -home-node NODE1 -home-port e0c -address IPADDR -netmask MASK
net int create -vserver CLUSTER -lif rep2 -role intercluster -home-node NODE2 -home-port e0c -address IPADDR -netmask MASK

Create some Data Aggregates:

aggr create -aggregate NODE1_aggr1 -node NODE1 -diskcount 20 -maxraidsize 20
aggr create -aggregate NODE2_aggr1 -node NODE2 -diskcount 20 -maxraidsize 20

Next step is to create some Vservers (SVMs I should say) and serve some Data!

To be continued...

Getting Started with the NetApp ONTAP 8.3 Simulator

... or ‘How to do a Basic Setup of an ONTAP 8.3 2-Node Simulator Cluster with VMware Workstation’.

I needed to refresh my lab (a bit late really), so thought I’d chronicle how to do a basic setup of a 2-Node ONTAP 8.3 Simulator cluster.

Initial VM Setups

Skipping the downloading from support.netapp.com, unpacking the files, opening in VMware Workstation bits - that really hasn’t changed much since I did this this post in January 2013...

- First thing to point out is that the ONTAP 8.3 Simulator VMX file has 5GB of memory configured; you can of course lower this if you want (say to 2GB).
- Secondly, you’ll probably want to change the virtual networks settings to work for you, I’ve stuck them all on my “Custom (VMnet1)” network, it really doesn’t matter much for the SIM (in the real world your Cluster Network is totally separate.)
- Thirdly, I always untick the “Connect at power on” for the Serial Port & Serial Port 2 (if you have multiple simulators using the same named pipe, VM Workstation errors and disconnects them anyway.)

Image: ONTAP 8.3 Simulator in VMware Workstation - Virtual Machine Settings

1.0 Cluster Node 1

1.1 Wipeconfig Procedure

Click the “Power on...”

When it says:

Hit [Enter] to boot immediately, or any other key for command prompt.

Press any other key.

At the VLOADER> prompt type

setenv bootarg.vm.no_poweroff_on_halt false
boot_ontap

N.B.: The no_poweroff just means when you halt ONTAP, the VM doesn’t power off. I prefer the VM to power off after I’ve halted it.

When it says:

Press Ctrl-C for Boot Menu

Press Ctrl-C

At the Boot Menu, select option 4 -

(4) Clean configuration and initialize all disks.

- and press Enter.

Zero disks, reset config and install a new file system?:

Type y and press Enter.

This will erase all the data on the disks, are you sure?:

Type y and press Enter.

... and wait ...

1.2 Node Setup

After completing the wipeconfig procedure, the SIM will come to:

Welcome to node setup.

And it will tell you that AutoSupport will be enabled from the start.

Type yes to confirm and continue {yes}:

Type y and press Enter.

Enter the node management interface port [e0c]:

Press Enter to accept e0c.

Supply the appropriate detail to the below prompts:

Enter the node management interface IP address:
Enter the node management interface netmask:
Enter the node management interface default gateway:

1.3 Cluster Setup

At this stage you can either use System Setup software, or continue in the console. For this post I’ll use the console.

At the login prompt enter admin and press Enter.

At the ::> prompt type cluster setup and press Enter.

Do you want to create a new cluster or join an existing cluster?

Type create and press Enter.

Do you intend for this node to be used as a single node cluster?

Type no and press Enter.

Will the cluster network be configured to use network switches?

Type no and press Enter.

It will then list the System Defaults for the cluster network.

Do you want to use these defaults?

Type yes and press Enter.

Supply the appropriate detail to the below prompts:

Enter the cluster administrator’s (username “admin”) password:
Retype the password:

... and wait ...

Step 1 of 5: Create a Cluster
Enter the cluster name:
Enter the cluster base license key: SMKQROWJNQYQSDAAAAAAAAAAAAAA

N.B.: There's 14 A's in that key.

... and wait ...

Step 2 of 5: Add Feature License Keys
Enter an additional license key:

Step 3 of 5: Set Up a Vserver for Cluster Administration
Enter the cluster management interface port [e0d]:
Enter the cluster management interface IP address:
Enter the cluster management interface netmask:
Enter the cluster management interface default gateway:

Enter the DNS domain names:
Enter the name server IP addresses:

Step 4 of 5: Configure Storage Failover (SFO)

Step 5 of 5: Set Up the Node
Where is the controller located:
Enter the node management interface port [e0c]:
Enter the node management interface IP address:
Enter the node management interface netmask:
Enter the node management interface default gateway:

Press enter to continue:

DONE!

2.0 Cluster Node 2

2.1 Wipeconfig Procedure

Click the “Power on...”

When it says:

Hit [Enter] to boot immediately, or any other key for command prompt.

Press any other key.

At the VLOADER> prompt type

setenv SYS_SERIAL_NUM 4034389-06-2
setenv bootarg.nvram.sysid 4034389062
setenv bootarg.vm.no_poweroff_on_halt false
boot_ontap

N.B.: The no_poweroff just means when you halt ONTAP, the VM doesn’t power off. I prefer the VM to power off after I’ve halted it.
N.B.: IMPORTANT! The only change from 1.1 is that we change the SYS_SERIAL_NUM and sysid, this is so we can apply licenses to node 2 later.

When it says:

Press Ctrl-C for Boot Menu

Press Ctrl-C

At the Boot Menu, select option 4 -

(4) Clean configuration and initialize all disks.

- and press Enter.

Zero disks, reset config and install a new file system?:

Type y and press Enter.

This will erase all the data on the disks, are you sure?:

Type y and press Enter.

... and wait ...

2.2 Node Setup

After completing the wipeconfig procedure, the SIM will come to:

Welcome to node setup.

And it will tell you that AutoSupport will be enabled from the start.

Type yes to confirm and continue {yes}:

Type y and press Enter.

Enter the node management interface port [e0c]:

Press Enter to accept e0c.

Supply the appropriate detail to the below prompts:

Enter the node management interface IP address:
Enter the node management interface netmask:
Enter the node management interface default gateway:

2.3 Cluster Setup

At the login prompt enter admin and press Enter.

At the ::> prompt type cluster setup and press Enter.

Do you want to create a new cluster or join an existing cluster?

Type join and press Enter.

It will then list the System Defaults for the cluster network.

Do you want to use these defaults?

Type yes and press Enter.

... and wait ...

Supply the appropriate detail to the below prompts:

Step 1 of 3: Join an Existing Cluster
Enter the name of the cluster you would like to join:

... and wait ...

Step 2 of 3: Configure Storage Failover (SFO)

Step 3 of 3: Set Up the Node
Enter the node management interface port [e0c]:
Enter the node management interface IP address:
Enter the node management interface netmask:
Enter the node management interface default gateway:

Press enter to continue:

DONE - 2 node cluster basic setup complete!

A State of NetApp 2015

Introduction

When this blog started way back in March 2010, I’d never had the fortune to touch or even see a NetApp device. Then in 2011 I had the good fortune to be working with a Citrix Consultant (thanks Ursatt Ankhs) who wanted best of breed NFS storage for a VDI implementation he was doing, and there started my love of NetApp Technology.

I’d been working with HP storage devices for years (and - to a lesser extent - Dell, EMC, IBM), and yes they had some cool stuff, but the NetApp Technology got me excited because of the agility, capabilities, power, freedom, and flexibility of their software. No longer did you need multiple different appliances each only capable of serving 1 purpose; 1 super powerful ONTAP appliance would serve for NAS (NFS/CIFS), SAN (iSCSI/FC), backup repository (SnapVault with Deduplication & Compression), with unprecedented integration with Enterprise applications, ..., and you didn’t need expensive forklift upgrades (you had simple headswaps instead, with all the disks and precious data remaining in-place.) SnapMirror is so flexible: “Need to move your datacentre?” no problem, fan in/out some SnapMirrors, or cascade some SnapMirrors, schedule a cutover, resync and it’s done!

I touched very little NetApp until early 2013, and since then I’ve been working mostly with NetApp technologies, and I couldn’t be happier - I love working with storage, I love working with cool technology, and NetApp is number one for me! NetApp is the last pure play ‘storage company’ standing, and I love this focus - it’s not after world domination, just wants to be the very best in data storage solutions!

A State of NetApp 2015

In all the time I’ve been working with NetApp technologies, I’ve never been so excited with the product portfolio as I am now in 2015, it really is an awesome product line up, and I just wish I had the time and opportunity to play with all the technologies. Here are some highlights (I’m no expert and no sales guy, just a geek with a passion for IT, and apologies in advance if I miss out any cool products.)

N.B.: Because I couldn’t do all the products true justice in my own words, some of the words (most) are taken from www.netapp.com.

2015 Product Portfolio

ONTAP 8.3 - now with MetroCluster! The World’s Number 1 Storage O/S keeps getting better and better, with more and more capabilities being added in every new release. It’s awesome now and it evolves so quickly that it’s hard to keep up with all that it can do. The mind boggles with the capabilities it will have in future releases.

AFF (All Flash FAS) - Who knew that ONTAP and Flash would go together so well? This is the best all flash box on the market! “Improve the speed of business and your ROI with high-performance, consistent low latency and rich data management!”

Want low-cost, enterprise-class data management and protection delivered virtually to branch offices? Check of NetApp Data ONTAP Edge.
Want to maximise your storage assets across domains? Use OnCommand Insight storage resource-management tools!
Want to automate storage processes? Get one-click self-service and cloud service delivery with OnCommand Workflow Automation!

Want to streamline storage management and simplify configuration, backup, and restore for enterprise operating environments? Check out NetApp SnapManager software for Exchange/ Microsoft SharePoint Server/ SAP/ Oracle/ Microsoft SQL Server/ Hyper-V / Virtual Infrastructure (VMware). And going beyond the SnapManagers, check out OS-independent Snap Creator Framework that integrates NetApp data protection with a broad range of third-party applications.

Looking to leverage public and private cloud as part of your backup and archive strategy? Game-changing NetApp AltaVault (formerly SteelStore) cloud-integrated storage delivers enterprise-class data protection - at up to 90% less cost than on-premises solutions.

Need to increase the flexibility and ROI of your existing arrays and embrace the power of ONTAP? Check out FlexArray!
Need to store and manage massive amounts of data worldwide, on-premises and in the cloud? Check out NetApp StorageGRID software!

Just SAN? Want to realise affordable, block-optimised storage performance and 99.999% uptime? Check out NetApp E2700 storage systems!
Just SAN? Want to optimise enterprise SAN applications? Check out NetApp E5600 storage systems!
Just SAN? Want all-flash to deliver fast, consistent response times to accelerate high-performance databases? Check of NetApp EF-Series!

Hybrid cloud integration with Amazon Web Services (AWS)? NetApp Cloud ONTAP for AWS lets you manage and maintain control of your resident cloud data on your terms. Pay only for what you use, when you use it.

Amazon Web Services? Check out NetApp Hybrid Cloud Solutions for Amazon Web Services. Transform you enterprise faster with seamless hybrid cloud from NetApp and Amazon Web Services.
Azure? Check out NetApp Private Storage for Microsoft Azure. Harness the power and control of a hybrid cloud solution from NetApp and Microsoft Azure.
SoftLayer? Check out NetApp Private Storage for SoftLayer. Extend SoftLayer cloud services with dedicated enterprise storage.
OpenStack? Check out NetApp Solutions for OpenStack. Deliver OpenStack cloud services quicker, easier, and with less risk with NetApp storage solutions.

SAP? Check out NetApp Advantage for SAP: Deploy, scale out and upgrade SAP applications faster. NetApp solutions enable agile, virtualised SAP infrastructures.

Unified Computing? Check out FlexPod! The FlexPod solution portfolio combines NetApp storage systems, and Cisco Unified Computing System servers, and Cisco Nexus fabric into a single, flexible architecture. FlexPod solutions are designed and validated to reduce deployment time, project risk and the cost of IT.

Branch and Department Workgroups? Empower them by using cloud-scalable NetApp Integrated VMware EVO:RAIL Solution

Already have Veeam? Check out Veeam and NetApp!

Sunday, 7 June 2015

When two Seemingly Identical CSV Files are Not!

I’m working on a PowerShell tool that needs to create CSV output, so I thought “if I create a standard text output with commas in, it will work.” It didn’t work first time and here’s why!

The code I was using to create my CSV file was like this:

$OutFile | Out-File $SavePath -Force

The problem is that Out-File defaults to Unicode. An easy way to demonstrate this is:

Out-File test.file

Open the file in bog-standard Notepad, go to File > Save As... and you’ll notice the current encoding is Unicode.

Image: Notepad showing Unicode file Encoding

The solution is a very simple change to the code:

$OutFile | Out-File $SavePath -Encoding Default -Force

If you’re wondering what default is, right-click the desktop and create a new text file, then open up in Notepad and go to File > Save As... again, and you’ll notice the encoding is ANSI!

Image: Notepad showing default ANSI file Encoding

And this leads on to the title. When I copy and pasted the output generated by my script into a freshly created text file, it worked as a CSV, but the original didn’t work as a CSV (everything was in one column); using -Encoding Default we now have success!