Default Reasoning

Construction of sensible guesses when some useful information is lacking and no contradictory evidence is present…

  • Subscribe

  • Disclaimer

    This blog is personal. The views and opinions expressed here represent my own and not those of the people, institutions or organizations that I may or may not be related with unless stated explicitly. All blog post, white papers and manuals were written during the projects, mostly at a customer site and are scenario specific. Use at your own risk.
  • Meta

Archive for the ‘Scripting’ Category

PowerCLI Basics – Create custom ESXi ISO image

Posted by Marek.Z on 4 March 2014

Here is a quick post on how to create a custom ESXi ISO image using PowerCLI.

Cmdlets used and the corresponding reference page:

  1. First, connect to the vCenter Server: PowerCLI C:\> Connect-VIServer <IP_or_FQDN>
  2. Next, add the ESXi offline bundle to the depot: PowerCLI C:\> Add-EsxSoftwareDepot C:\VMware-ESXi-5.5.0-1331820-depot.zip
  3. Add a custom driver to the depot. I used the iSCSI Driver for Emulex: PowerCLI C:\> Add-EsxSoftwareDepot C:\be2iscsi-10.0.727.44-offline_bundle-1525244.zip
  4. Clone the ESXi image: PowerCLI C:\> New-EsxImageProfile -CloneProfile ESXi-5.5.0-1331820-standard -Name ESXi-5.5.0-custom -Vendor VMware
  5. Get the Emulex driver name: PowerCLI C:\> Get-EsxSoftwarePackage -Vendor Emulex
  6. Add the driver to the new image: PowerCLI C:\> Add-EsxSoftwarePackage -ImageProfile ESXi-5.5.0-custom -SoftwarePackage ima-be2iscsi,scsi-be2iscsi
  7. The new drivers should now be listed in the package.PowerCLI-ISO-1
  8. Export as ISO: PowerCLI C:\> Export-EsxImageProfile -ImageProfile ESXi-5.5.0-custom -FilePath C:\ESXi5.5.0-custom.iso -ExportToIso

Done.

Tested using vSphere PowerCLI 5.5.

Or you can use the ESXi image customization script by Andreas Peetz :)

Cheers!

- Marek.Z

Posted in How To, PowerCLI, Scripting | Tagged: , , , , , , , , , | Leave a Comment »

PowerCLI Basics – Import Host Profile

Posted by Marek.Z on 18 February 2014

A quick post on how to import a host profile into vCenter Server using vSphere PowerCLI.

Here is the link to the cmdlet reference page.

  1. Open PowerCLI and connect to you vCenter Server: PowerCLI C:\> Connect-VIServer <IP_or_FQDN>
  2. Next, use the following to import the profile: PowerCLI C:\> Import-VMHostProfile –FilePath <Path> -Name <Profile_Name> -ReferenceHost <ESXi_host_Name>

For example:

PowerCLI C:\> Import-VMHostProfile -FilePath D:\HostProfiles\Default.vpf -Name Default -ReferenceHost host-01.dr-lab-e.local

Done.

As you can see the host profile is now displayed under Host Profiles in the vCenter Server. All you have to do now, is to link it to the cluster and apply it to the hosts.

PowerCli Basics - Import Host Profile 1

Note: make sure that the reference host is online and is accessible or you will receive an error message in the PowerCLI window stating that the host is invalid or incompatible.

PowerCli Basics - Import Host Profile 2

This of course can also be done in the vCenter Server through the Host Profile import wizard. :)

Cheers!

- Marek.Z

Posted in PowerCLI, Scripting | Tagged: , , , | Leave a Comment »

ESXCLI Basics: Configure Dump Collector Host

Posted by Marek.Z on 15 January 2013

Another basic command, but may be useful in stateless environments with no local disk usable for a diagnostic partition. Here is a quick how-to.

  1. Connect to your host through SSH or open the DCUI.
  2. Setup the VMkernel interface, remote server IP address and port: # esxcli system coredump network set -v vmk0 -i 10.10.10.10 -o 6500
  3. Enable the remote dump collector host: # esxcli system coredump network set -e true
  4. Verify the settings: # esxcli system coredump network get
  5. Logout.

Done!

Verify if the ports are open on the firewall though vSphere Client or vSphere Web Client. This could of course be applied to the host through the Host Profiles. One more thing, ESXi Dump Collector is not supported on vSphere distributed switches (at the time of this writing).

Cheers!

- Marek.Z

Posted in Dump Collector, ESXCLI, ESXi 5, ESXi 5.1, VMware, vSphere 5 | Tagged: , , , , , , , | Leave a Comment »

ESXCLI Basics: Configure Syslog Host

Posted by Marek.Z on 8 January 2013

Another basic command, but essential for health monitoring of your hosts when using a Syslog Server. Here is a quick how-to.

  1. Connect to your host through SSH or open the DCUI.
  2. Setup the target Syslog Server and place logs in an unique subdirectory: # esxcli system syslog config set --logdir-unique true --loghost=udp://10.10.10.10:514
  3. Open the ports for Syslog on the firewall: # esxcli network firewall ruleset set –e true –r syslog
  4. Apply the configuration with: # esxcli system syslog reload
  5. Verify the configuration with: # esxcli system syslog config get
  6. Logout.

Note: mind the double dashes in step 2.

Done!

Verify if the ports are open on the firewall though vSphere Client or vSphere Web Client. If the syslog settings are not reflected in the Advanced Settings of the host after you configure them, they will be visible after a reboot.

Cheers!

- Marek.Z

Posted in ESXCLI, ESXi 5, ESXi 5.1, How To, VMware | Tagged: , , , , , , | Leave a Comment »

ESXCLI Basics: Setup SNMP on ESXi 5.x

Posted by Marek.Z on 24 December 2012

This is really basics stuff, but here is a quick how to.

  1. Connect to your host through SSH or open the DCUI.
  2. Setup the target SNMP server, port and community string: # esxcli system snmp set –t <ip_or_fqdn>@/<community_string>
  3. Enable SNMP: # esxcli system snmp set –e yes
  4. Logout.

Done! :)

Verify the snmpd service is running and check if the ports are open on the host though vSphere Client or vSphere Web Client.

Please note that the esxcli system snmp namespace is available from vSphere CLI version 5.1.

Cheers!

- Marek.Z

Posted in ESXCLI, ESXi 5, ESXi 5.1, How To, VMware, vSphere | Tagged: , , , , , | 2 Comments »

 
Follow

Get every new post delivered to your Inbox.

Join 587 other followers