Stop & Remove All Docker Containers

If you want to remove all docker containers. You can use simply following commands. The first command will stop all running docker containers and the second command will delete them.

Stop All Containers

Remove All Containers

Nutanix Prism Demo Video AOS 5.1

Heres a great video demo of Nutanix Prism interface.

Its always best to demo Prism live so that you can drill into each element in more detail, focusing on the topics that a  prospect would like to see more in more detail. However, sometimes due to network constraints this isn’t always possible. I really like this recording of the Prism demo that was put together by Eric Wamsley a fellow Systems Engineer at Nutanix.

Passwordless sudo

 

The Nutanix Calm product is great for automating the deployment of applications stacks. So I’ve been learning Calm by attempting to deploy some LEMP stacks and other application on Ubuntu Images. However I was stuck at trying to issue scripts which needed sudo elevation, being prompted for a secondary password is a pig when trying to script anything.

The quick answer to this is to make sudo passwordless.

You do this by creating a file in /etc/sudoers.d/ (I called mine passwordless) and adding a line …

Replacing <username> with the user you wish to apply the passwordless sudo to.

That’s it, no more being prompted for sudo passwords.

Clone and connect Nutanix Volume Group using PowerShell

Hardev Sangera and I held a breakout session at Nutanix .Next on Tour in London. The session was predominately to demo’s of some of the new features released with AOS5.0. During the session we demonstrated how to present iSCSI storage to a physical workload and then subsequently take a clone of that data and so it could be used to perform development activities on.

Enabling a DBA or developer ‘live like’ data to work with, which  can take hours with traditional methods.

Rather than using the Prism interface to clone the volume group and the iScsi initiator in windows to connect to it, I wrote a PowerShell Script demonstrating the use of  API and the Nutanix PowerShell CMDlets.

Disclaimer : I’m not a professional coder so don’t rip it to shreds when you read it, as there are significant improvements that could be made and it is only to serve as an example of leveraging the Nutanix API.

 

The script to disconnect and remove the Volume Group…

 

Clone-NTNXVolumeGroup CmdLet Parameters

To obtain the list of manditory and Optional parameters of a CmdLet (Clone-NTNXVolumeGroup in this case), you can use the the following :-

 

the above returns :-

 

Nutanix PowerShell Cmdlets

I’ve just been preparing for a Demo at the Nutanix .Next event in London which is on the 30th March 2017 – Link to register here http://events.nutanix.com/event/?id=1470024841-579ecc89d9db5-579f887683408.

One of the things I’m doing is cloning a Volume Group Presented by Acropolis Block Services. Im doing this by PowerShell so wanted a list of the commands. Just thought I’d share the command I used to obtain it.

 

Look out for the VG Clone Script once it is complete.

Using the Nutanix Rest API v2 with Python to list cluster VM names

Nutanix Rest API has always interested me as it is a very powerful tool. I have only really used it via the explorer, which allows you to test various queries and outcomes.

Rest_explorer

I wanted to see how easy it would be to obtain information from the Nutanix cluster to use in other applications and ‘Real {Men/Women} don’t click’ so I fancied trying my hand at utilising the API via Python.

To kick things off I’ll obtain a list of the VM’s in the cluster this should be as easy as calling the GET VM’s API.

I’ll be using the Python 3.6 interpreter, so the syntax may differ slightly on earlier versions (ie 2.x)

First I need the request module to perform the REST actions, I’m using pip to install this…

I start by creating the base url, in this example I will utilise v2.0 of the Nutanix Rest API

where 192.168.0.157 is the cluster IP address. The base URL can differ between CE and retail versions of Acropolis so check your’s using the Explorer.

I can then construct the Request with authentication and header details :

now I can request the data as JSON from the path I wish to use which are listed using the explorer :

these are appended to the base url and stored in the data variable as JSON.

Using the rest api explorer we can see what the JSON will return by clicking the ‘Try it out’ button.

My test has returned 3 items labeled ‘entities’ which have different sub attributes.

I want to return a list of all the VM’s running on my cluster so I can use the following to loop through each entity and print the attribute of ‘name’

So in the above e becomes each entity and name references the sub value within each entity and returns

which are the 3 VM’s I have running in my test cluster.

Full source code below…

Summary

The above exercise is just to demonstrate basic REST API usage and should get you started. In later posts I’ll be looking at using the API to perform actions. Stay Tuned.

 

Add a Folder to the Write Cache drive of Multiple PVS Targets – PowerShell

I recently needed to create a folder on the Writecache disk for the persistence of Eventlog files. Unfortunatley the customer already had around 40 XenApp hosts deployed.

I wrote a script which can be run from a machine with the Citrix Powershell commandlets installed, ie DDC. This Script lists all the Targets in the site and pipes them to the create folder command.

Ensure you have enabled the Citrix Snapins first…

And heres the code I created…

Smart-X ControlUp and PVS Cache In Ram

When visiting a customer I’m often like to get a feel for the performance of their Citrix farm so I can see what improvements can be made. A fantastic tool for doing this is Smart-X Control-Up. Control-Up is the ultimate administration and real time monitoring tool. Not only can you see, in real time, what’s happening in your RDSH/VDI Farm but it also provides administrators with all the tools necessary to support and administer it. I like the analogy that its like a Medical ECG, you simply run the executable which then installs an agent on your VDI or RDSH hosts and then instantly you see the environments vital statistics.

VDI Environment in ControlUp

VDI Environment in ControlUp

There are loads of great admin features to make life managing the environment easier. One such killer feature, I love, is being able to select a user session and kill Group Policy being applied to that user, thus enabling the admin to change a browser setting, execute admin console, regedit or whatever is being restricted by GP.

Just one of the many built in features, there are far too many to write about in this blog, I suggest you go to their website and check it out for yourself.

As well as being able to use the built in features, Control-Up is extensible by creating your own Script Based Actions. These actions can be developed in house and/or shared with the community, there are already a large selection of scripts available to perform different tasks.

Its really quite easy to do, in fact I wrote my own. All that was involved was a slight modification to a PowerShell script I had previously developed. After some verifications and tweeking from Smart-X, it has now been published and shared for all to use, they even made a video showing how to use it. http://www.controlup.com/pvs-write-cache-size/

Just one example of how admin and community oriented this product is, I urge you to download the demo and give it a try for yourselves. http://www.controlup.com/ you’ll be supprised how great it is.

 

1 2 3 7