Import OVF/OVA: No datastore found on target in vCenter Server 5.1


I was trying to import an OVF/OVA template to one of my lab environments. But unfortunately this was not possible because of an error:

image

In this environment we are using Folders to organize the datastores. See the screenshot below:

image

This works for most of the time but when you want to import an OVF/OVA template you have to give up your folder structure to enable the OVF template. This is a small bug in vCenter Server 5.1. See KB2045635 for more details.

This is a small quote from the KB article:

This is a known issue affecting VMware vCenter Server 5.1.

Try one of the following workarounds:

  • Use vSphere Client to deploy.
    Open the vSphere Client and use it to deploy the OVA/OVF file.
  • Use Web Client to deploy.
    If the datastore is  in a folder, remove it from the folder and try to deploy.

In this case I had to move the SDRS cluster and the datastores attached to this SDRS cluster from the yellow folder to the root folder inside the Storage view of the vSphere web client.

Now I was able to deploy the OVF/OVA template.

Advertisement

PowerCLI: Copy Datastore Items


In this short post I will show a PowerCLI script I wrote to copy ISO files from datastore y to datastore x. The datastores are in the same vCenter and virtual datacenter accessible but the vSphere hosts are located inside two different IP subnets and a firewall rule prevents to copy files between the two subnets. So I had to think about a work around. Well this one is easy. On the vCenter server I created a script to peform the following steps:

  1. Create two PSDrives for each Datastore
  2. Get al the ISO filenames
  3. Downlad the ISO to the c:\tmp directory from datastore y
  4. Upload the ISO from the C:\tmp directory to the datastore<X>\iso directory
  5. Remove the ISO from C:\tmp
  6. repeat the steps above until all the ISO files are copied to the new datastore.

The PowerCLI script to perform the described tasks:

New-PSDrive -location (get-datastore template-01) -name tpl01 -PSProvider VimDatastore -Root '\'
New-PSDrive -location (get-datastore template-02) -name tpl02 -PSProvider VimDatastore -Root '\'

$isos = ls tpl01:\iso\ | % {$_.Name}
foreach($iso in $isos){
    Write-Host "copy $($iso) to C:\tmp" -fore Yellow
    Copy-DatastoreItem -item tpl01:\iso\$iso -Destination C:\tmp
    
    Write-Host "copy $($iso) to template-02\iso" -fore Yellow
    Copy-DatastoreItem -item C:\tmp\$iso -Destination tpl02:\iso
    
    Write-Host "removing the tmp file $($iso) from C:\tmp" -fore Yellow
    Remove-Item C:\tmp\$iso -confirm:$false
    
    Write-Host "done" -fore Green
}

So once again PowerCLI to the rescue.

PowerCLI: Easy NFS datastore setup


It’s a new year so let’s start with a new PowerCLI post. This post is inspired by the blog post of @alanrenouf: PowerCLI easy vswitch portgroup setup. I love the whole idea of taking a good working config from a vSphere host and use it on a fresh installed vSphere host to make sure it’s compliant.  In this post I will show you how to perform the same trick with NFS datastores like Alan did with the vSwithes and Portgroups.

My home lab contains two HP ml110 g5 and a simple P4 box with some hard disks to add shared storage to the lab. It’s running Debian linux and is capable of presenting iSCSI targets, NFS and SAMBA shares .I use NFS as shared storage for my vSphere lab.

On esx2.ict-freak.local I use the following NFS datastores:

image

But I messed up the configuration of the other vSphere host in my lab called esx1.ict-freak.local. So I had to reset the network settings and lost all the NFS datastores:

image

So I needed to add the five NFS shares. This is a nice task for PowerCLI and the New-Datastore cmdlet:

Update: I had to remove the last / from the Path variable. If you do not remove the last / the script will mount the NFS share but with a new UUID. See Damian Karlson his post about this subject here.

Continue reading “PowerCLI: Easy NFS datastore setup”