Setting up fling using OVA methods is very simple on the FAMI interface on the 5490 port. The generated code is relatively low, however, again, the map referred to for functionality that was expressed by the official VMware PowerCLI posts may have the features upgraded to PowerCLI cmdlets in the future.
How can I export a VM in the OVA format with VMware ESXi 6.5? In vCenter (vSphere Client version 6.5) I can only export as an OVF. The same is true for the ESXi web client. The old application (VMware vSphere Client 6.0 and bellow) allowed me to pick OVA, but I can't access an ESXi 6.5 host with this application.
The error I get is: 'The required client support files need to be retrieved from the server '0.0.0.0' and installed' I've tried using VMware OVF Tool to convert from OVF + VMDK to OVA without success. Is there any other solution?
Virtualised environments can range pretty wildly in size; from one physical server in a small business or test lab with a few VMs, right up to large enterprises with hundreds or thousands of physical servers and seemingly limitless VMs. Whatever the size of your environment, as a good system administrator, you know that it’s important to configure it in a consistent manner, and automate as much as is reasonably possible. If you’re using hypervisors and vCenter as the management software, then you already have access to a number of automation tools to assist with making your infrastructure function as smoothly as possible.
These include VMware, VMware and VMware. In this article, I will be focusing on VMware, the automation tool supplied as a snapin for Microsoft’s Windows PowerShell command line tool and scripting language, as well as 10 ways that any system administrator can kick-start the automation of their virtual infrastructure. Getting Started As I just mentioned, vSphere PowerCLI is provided as a snapin for Microsoft’s Windows PowerShell, and so to use it you will need:.NET Framework 2.0 SP1. Windows PowerShell 1.0 or 2.0. Note If you have Windows PowerShell 2.0, then I’d advise installing.NET Framework 3.5 SP1, since you’ll then have access to the built-in PowerShell ISE and cmdlets (such as Out-GridView). Of course, you should always refer to the for up-to-date system requirements. Connect - VIServer HostServerName The system will use the credentials you are currently logged-on with to establish a connection with the target.
Alternative credentials can be specified with the -Username and -Password parameters, if necessary. If the current credentials are not sufficient, then you may be prompted to enter more appropriate credentials via a standard Windows dialogue box. 10 Steps to Kick Start Automation Now that you’ve got your VMware automation tools configured and connected, it’s time to look at how to use them to get as much of your VM maintenance automated as possible. As you’ll see, I’ve broken this kick-start process down into bite-sized steps to make it easier to follow. These steps are individual stand alone operations, although they can be scripted to make powerful combinations.
Taken together, all 10 steps will give you a solid foundation for putting some more sophisticated automation in place. Before you get started, I recommend downloading Alan Renouf’s excellent, just in case you want to look up the details of any of the cmdlets I’ll be discussing. 1) Reviewing and Configuring Virtual Machines The reason virtual infrastructures are put together is primarily (and unsurprisingly) to run virtual machines, so a good place to start is with the Get-VM cmdlet, which can produce a simple inventory of all VMs currently found within VMware vCenter. Using the Get-VM cmdlet, and the standard PowerShell Select-Object cmdlet, you can retrieve the particular properties that are of interest and use Export-CSV to export that data into the ever-useful CSV file format for further manipulation and distribution. Export - CSV VMs.
Csv - NoTypeInformation A sample result of which is shown below: Another example where this cmdlet can be put to good use is to alleviate a common stumbling block when attempting to VMotion virtual machines from one ESX host to another ( in case you don’t use VMware regularly, “to VMotion virtual machines” means “to use VMware VMotion to Live Migrate virtual machines to another physical host”). There are a number of reasons why a virtual machine might not be permitted to VMotion; one of the most common is because it has a local CD-Rom drive attached. The below set of commands will iterate through all virtual machines, filter them based on whether the connection state of their CD-Rom drive is true, and return the name of the offending virtual machine(s). Select - Object Name One of the great things about PowerShell is the intuitive possibility to gradually build up a set of commands to carry out increasingly more complex actions. This means it becomes possible to both review and appropriately configure your VMs in a single step. In this instance, as well as retrieving the list of virtual machines where the CD-Rom is connected, it is very simple to extend the above command to automatically disconnect these CD-Roms, rather than carry out that task manually.
Simply use the Set-CDDrive cmdlet to change the connection status of any connected CD-Roms which have been found. Get - CDDrive Set - CDDrive - Connected $ false - Confirm: $ false This is just a single example, but now that you know how to quickly gather the data you need, you can easily target specific settings and make appropriate configurations a snap. You can find out more about what cmdlets are available to adjust your VMs’ settings from the PowerCLI website, as mentioned earlier.
2) Basic Capacity Information The PowerCLI cmdlets can be used to give a quick overview of the number of hosts and VMs that exist within the Virtual Center; it could be useful to record these figures on a monthly basis so that the growth of the environment can be tracked over time. How about finding the average number of VMs per host in a cluster? Again, a useful figure to regularly record so as to observe what consolidation ratios are being achieved and to plan for future capacity needs, and a figure which PowerCLI can help you find.
In the code below, we retrieve the ESX / ESXi hosts & VMs and observe their count; note the use of the $DefaultVIServer variable, which is updated each time a connection is made to a vCenter. For the average number of VMs in each cluster, we find the total number of ESX / ESXi hosts and VMs and perform some basic maths to arrive at a figure. Note the use of some basic.NET math::round code and the number of decimal places (1) required to format the output as desired. 3) Rescanning for New Storage What used to be one of the most onerous tasks for a VMware administrator was using the vSphere Client GUI to re-scan all hosts in a cluster for new storage after an additional SAN Lun had been provisioned. This would require individually selecting each host within the cluster, scanning it for new storage, and then moving on to the next host until all were complete – a process which quickly becomes frustrating. Thankfully, in vSphere 4.0, VMware added a new option when right-clicking a cluster – Rescan for Datastores. Once initiated, this task would work through each host in the cluster and scan for new storage.
However, if you are running a VMware version prior to version 4.0 in your environment, or maybe you want to rescan hosts in more than one cluster, then the Get-VMHostStorage cmdlet has two parameters which you’ll find useful: -RescanAllHba and -RescanVmfs. Used in combination with the Get-Cluster and Get-VMHosts cmdlets, Get-VMHostStorage can quickly become very powerful; for example, the command below will rescan for new storage on all of the hosts in Cluster 1. Get - VMHostStorage - RescanAllHba - RescanVmfs 4) VMotion Virtual Machines to other Hosts As a virtual infrastructure admin you will, from time to time, need to carry out maintenance on a host server, whether through patching or hardware replacement. As I’ve already alluded to, VMware provide some fantastic VMotion technology within ESX and vCenter, which enables virtual machines to be transferred from one physical host to another with no downtime incurred for the virtual machine.
To move all VMs from one host to another, use this simple one liner. First of all, the name of the source host will be stored in the variable $sourcehostname.
Then we retrieve all of the hosts within Cluster 1, drop the source host from that list, and store the results in $clusterhosts. Next, we retrieve all of the virtual machines on the source host, storing them in $vms, and finally we cycle through each virtual machine, generate a random target host and move the VM to that target host.
5) Storage VMotion Virtual Machines to a New SAN In a similar way to how the VMotion technology migrates a virtual machine from one physical host to another, it is also possible to move the disks for a virtual machine between datastores whilst the virtual machine remains online – this technology is known as Storage VMotion. This is even possible between different SANs, provided the hosts are configured to see storage on both old and new SANs and there is sufficient bandwidth to transfer the necessary data. Let’s say you have mapped out in, a CSV file, which datastore the disks for each virtual machine are moving to: We can bring that data into the PowerShell session with the Import-CSV cmdlet, and then feed it into the Get-VM and Move-VM cmdlets to Storage VMotion those virtual machines to the new SAN.
Note that the Import-CSV cmdlet will take the column headers in the CSV file and enable access to them as property labels; i.e. For line 2, $vm.name is Server01 and $vm.targetdatastore is Datastore1NEW. When carrying out such a SAN migration, you may wish to carry out the work outside of normal office hours to take advantage of low-use periods on the SAN, and consequently move the data quicker. So, why not create a Windows Scheduled Task to kick off the above script and schedule it for the required time? If you wanted to be really smart, you could use the Send-MailMessage PowerShell cmdlet to have it email you each time a Storage VMotion completes. 6) Deploying Virtual Machines from a Template Deploying new virtual machines is a simple task, particularly if you’ve created a base template and use the Guest Customisation feature to sysprep a new Windows virtual machine.
However, even this process can quickly become tedious if you’re deploying multiple virtual machines from the GUI. Let’s take an example where you have the requests for five new virtual machines provided to you in a CSV file: The virtual machines can be easily deployed by, once again, using Import-CSV to read in the input data. Then we cycle through the virtual machines and, for each deployment, get the template, host,datastore and customization to use, before finally executing the New-VM cmdlet and feeding it those various parameters to use for creating each VM. 7) Configuring vSwitches and Port Groups Keeping the networking configuration consistent and accurate across all ESX / ESXi hosts in a cluster is crucial. This is particularly the case for technologies like VMotion, which requires identically configured networking on the source and target hosts to enable virtual machines to transfer between them.
In an enterprise environment, it would be very common to have multiple VLANs made available via multiple port groups on different vSwitches. Consequently, when deploying a new ESX / ESXi host into a cluster, a significant amount of manual networking configuration could be required, which could easily lead to mistakes being made, and one very bored administrator. To address this, VMware have introduced some new technology into vSphere 4.0, known as Host Profiles; however this is only available to customers who have purchased Enterprise Plus licensing.
Well known PowerCLI community expert Alan Renouf has provided a simple alternative solution to this problem (rather than reproduce the script here, I recommend you take a look at his blog once you’ve finished here. I’ll include a link at the end of the article). This short script will prompt the administrator for a source and target host, copy the network configuration from the source host and apply it to the target. Simple, yet very effective, and a great time saver; and no requirement to use Host Profiles. 8) Configuring an NTP Time Server Another item to keep consistently configured across the ESX / ESXi hosts is the NTP server used to keep the time. Whether setting this on a new host or making a change across all hosts, it’s a snap to do it with PowerCLI.
To add an NTP server to a new host, esx01, not previously configured use. Get - VMHost esx01 Add - VMHostNtpServer - NtpServer ntpservername 9) Patching Via VMware Update Manager As mentioned at the beginning of the article, there is an additional set of commands which can be used in conjunction with VMware Update Manager to assist with the automation of patching ESX / ESXi hosts or VMs. When planning a patch deployment, it might be necessary to provide information up front to management regarding the list of patches which you intend to install. Whilst VMware Update Manager has a GUI which is useful for most tasks, it is difficult to extract this information out from the GUI and into a distributable format. The code below will find the compliance status of a host, as scanned against a baseline, and then export a list of patches required by that host out to a CSV file. $ Baseline Remediate - Inventory - Entity esx01 - Confirm: $ false These commands could all be added to a short script to be run at the end of a build process, to ensure that all newly deployed hosts are at the required patch level. 10) Schedule the vCheck Reporting Script to Run Daily The previously mentioned PowerCLI community expert, Alan Renouf, has put together an amazing and, very generously, completely free PowerShell reporting script, which can be run against a vCenter environment and report back on many common issues and best practises.
This report is known as vCheck, and is available from. It is a great way to be proactive and find issues with the infrastructure before they become serious. Common issues that will be found include snapshots which are over a specified number of days old, VMs with no VMware Tools installed, and datastores with less than a specified amount of free space available. It is highly recommended to schedule this report to run against your vCenter and have it email you with the results on a daily basis – you will most likely find issues you did not even know you had!
Summary VMware environments of any size, small or large, can benefit greatly from automation. This article has introduced you to some of these possibilities and how you might use them to make your systems run better, in a more consistent fashion. The beauty of this is twofold: you’ll find it significantly easier to be aware of the status of all your virtual environments, and you’ll have more time to spend on the projects that you never get around to.
Not only will you be proactive, but you’ll also have more time to feel self-satisfied about it. PowerCLI is intuitive to use, and it is incredibly simple to very quickly get real results with it – I urge you to give it a try, if you haven’t already done so! Resources VMware Tools:. This article was commissioned by Red Gate Software, engineers of ingeniously simple tools for optimizing your Exchange email environment. Learn more about. Jonathan Medd has been working with Windows Infrastructure products since 1997 and, more recently, virtualisation technologies from VMware. In 2007, he discovered Windows PowerShell and now spends a lot of time encouraging the IT pros he meets to use PowerShell by talking with them, giving presentations to User Groups, and via.
He also co-hosts the podcast, which contains info on how to learn PowerShell and what's going on in the PowerShell world. In April 2010, he was awarded status as a Microsoft Most Valuable Professional (MVP) for PowerShell, and you can follow him on Twitter at.