It turns out there’s a lot to getting Powershell to connect to FTP servers. Here’s two functions I’ve written that can list FTP contents and download files. Enjoy.

Comment and share

VMWare released “Photon” earlier this week, which is a lightweight Linux OS for hosting Docker containers. It’s amazingly slim like CoreOS and deploys in a matter of seconds. I gave it a spin today and it worked pretty well. Installing it on vSphere was pretty straightforward following documentation on the Photon GitHub site. Once it was installed, I needed to make a few changes to get it working smoothly.

Setting the proxy

If your environment uses a proxy to connect to the internet, continue with this section. If not, skip.

First, create a new directory to store the extra configuration.

1
mkdir /etc/systemd/system/docker.service.d

Next, create a http-proxy.conf file in the directory and edit it.

1
2
touch /etc/systemd/system/docker.service.d/http-proxy.conf
nano /etc/systemd/system/docker.service.d/http-proxy.conf

Add the following information to the file (substituting where necessary) and save with Ctrl + X.

1
2
[Service]
Environment="HTTP_PROXY=http://username:password@proxy.example.com:8080/"

Reload the systemd daemon and restart Docker.

1
2
systemctl daemon-reload
systemctl restart docker

Docker now has access to the internet.

Allow Docker connection via TCP

By default, Docker only allows connection through UNIX sockets. Since we will be controlling it via the Windows client, we need TCP access.

Open up the Docker service file in nano

1
nano /etc/systemd/system/multi-user.target.wants/docker.service

Edit the Service -> ExecStart line to allow TCP connections by changing:

1
ExecStart=/bin/docker -d -s overlay

to

1
ExecStart=/bin/docker -d -s overlay -H tcp://0.0.0.0:2375

Reload the systemd daemon and restart Docker.

1
2
systemctl daemon-reload
systemctl restart docker

Upgrade the Docker binary

Photon comes with Docker 1.5.0 but unfortunately the Windows client only works with 1.6.0 and above.

If you are using a corporate proxy, you will first need to set the http_proxy environmental variable so wget works

1
export https_proxy="http://username:password@proxy.example.com:8080/"

Download the Docker 1.6.0 binary

1
wget https://get.docker.com/builds/Linux/x86_64/docker-1.6.0

Move the binary to /bin/ and mark it as executable

1
2
3
4
5
systemctl stop docker
rm -r /bin/docker
mv docker-1.6.0 /bin/docker
chmod +x /bin/docker
systemctl start docker

You will now have Docker 1.6.0 running.

Connecting from Windows

Download Docker 1.6.0 for Windows from Docker.com - 32-bit or 64-bit and open PowerShell in that directory. At this point I recommend renaming the file to docker.exe.

To connect to the Photon host, run the following:

1
.\docker.exe -H=tcp://photon.ip.address.here:2375 info

This will show information about the Docker host like so:

1
2
3
4
5
6
7
8
9
10
11
Containers: 12
Images: 49
Storage Driver: overlay
Backing Filesystem: extfs
Execution Driver: native-0.2
Kernel Version: 3.19.2
Operating System: <unknown>
CPUs: 2
Total Memory: 489.7 MiB
Name: bvdocker1
ID: <id here>

You are now connected!

Comment and share

To install (requires a restart):

dism /online /Enable-Feature /FeatureName:Internet-Explorer-Optional-amd64

To uninstall (doesn’t require a restart):

dism /online /Disable-Feature /FeatureName:Internet-Explorer-Optional-amd64

Comment and share

This is a possible scenario that can happen with Veeam and Server 2012 deduplication:

1
You cannot write to a file anymore and you get the error "ERROR_FILE_SYSTEM_LIMITATION". There is still plenty of space left on the volume however this file can't grow. This is a big issue wince you use rollback chains in Veeam.

To fix this unfortunately you need to start a whole new chain on a new volume. When formatting the volume, use format drive: /fs:ntfs /v:volumelabel /Q /L. The /Q switch does a quick format, and the /L switch enables large-size file records.

Unfortunately this switch isn’t very well documented - it’s not even in the format.exe knowledgebase article. You can however get some information from format /? in command prompt.

1
2
/L NTFS Only: Use large size file records.
By default, the volume will be formatted with small size file records.

A Microsoft primer on how NTFS works (Source.aspx)) sheds some light but it doesn’t show you the limit of setting large-size file records.

Reference: Microsoft KB2891967

Comment and share

  • page 1 of 1

Jacob Ludriks

author.bio


author.job