Sometimes it’s annoying when Photon OS based appliances doesn’t allow to use previously used password for root user. You may see the error ‘Password has been already used. Choose another‘ when you try to use the password which was used earlier.
root@test [ ~ ]# passwd
New password:
Retype new password:
Password has been already used. Choose another.
By default, Photon OS remember last Five passwords. You can see the setting ‘remember=3’ in /etc/pam.d/system-password
Please find the steps to upgrade VMware Cloud Director App Launchpad from version 2.0 to 2.1
Download VMware Cloud Director App Launchpad 2.1 RPM package from here.
Upload it to the App Launchpad VM.
Open an SSH connection to the App Launchpad VM and log in as root.
Upgrade the RPM package.
[root@test ~]# rpm -U vmware-alp-2.1.0-18834930.x86_64.rpm
warning: vmware-alp-2.1.0-18834930.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID 001e5cc9: NOKEY
Upgrading...
Execute 'alp upgrade' to upgrade ...
Append the excute permission to the existing logs...
5. Run the following command to upgrade App Launchpad.
[root@test ~]# alp upgrade --admin-user administrator@system --admin-pass 'passwd'
Upgraded the plugin of App Launchpad successfully.
Upgraded the management service successfully.
[Upgrade Task]
CREATE_ENTITY_TYPE_CATALOG_INFO : true
MIGRATE_CATALOGS : true
CREATE_ENTITY_TYPE_SIZING_TEMPLATE : true
MIGRATE_LEGACY_SIZING_TEMPLATES : true
CREATE_ENTITY_TYPE_MARKETPLACE_BANNER : true
CREATE_ENTITY_TYPE_ORG_METRICS : true
UPGRADE_SERVICE_ROLE : true
6. Restart alp service and confirm its running.
[root@test~]# systemctl restart alp
[root@test ~]# systemctl status alp
● alp.service - VMware ALP Management Service
Loaded: loaded (/usr/lib/systemd/system/alp.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2021-11-18 11:46:14 +01; 14s ago
Main PID: 29334 (java)
CGroup: /system.slice/alp.service
└─29334 java -jar /opt/vmware/alp/alp.jar --logging.path=log
Nov 18 11:46:14 bd1-srp-al01.acs.local systemd[1]: Stopped VMware ALP Management Service.
Nov 18 11:46:14 bd1-srp-al01.acs.local systemd[1]: Started VMware ALP Management Service.
7. Diagnose deployment errors by running the /opt/vmware/alp/bin/diagnose executable file.
The diagnose tool verifies that the services are up and running and that all configuration requirements are met.
[root@test ~]# /opt/vmware/alp/bin/diagnose
Step 1: System diagnose
--------------------------------------------------------------------------------
- App Launchpad service is initialized.
Step 2: Cloud Director diagnose
--------------------------------------------------------------------------------
- Service Account for App Launchpad is good.
- App Launchpad's extension is ready.
Step 3: MQTT diagnose
--------------------------------------------------------------------------------
- Cloud Director MQTT for extensibility is ready.
Step 4: Integration diagnose
--------------------------------------------------------------------------------
- App Launchpad API is up, and version is 2.1.0-18834930.
Step 5: App Launchpad diagnose
--------------------------------------------------------------------------------
- App Launchpad service is listening on port 8086.
8. Confirm the ALP version.
[root@test ~]# alp
NAME:
alp - The Cloud Director App Launchpad
(ALP) Command-line tool
USAGE:
alp <subcommand> [flags]
VERSION:
'2.1.0-18834930'
Lambda is an AWS offering to build serverless applications. It helps you to run code without provisioning or managing servers. The Lambda functions can be invoked directly through API calls or in response to events. AWS will charge the customer only for the compute time consumed by Lambda function, so no need to pay for idle time. You can learn more about lambda here.
AWS Lambda, PowerShell and PowerCLI
The code you run on AWS Lambda is uploaded as a ‘Lambda Function’. AWS Lambda natively supports PowerShell as scripting language. It helps us to write Lambda functions in PowerShell which includes commands from PowerCLI modules.
Let us see the steps to create a PowerShell based Lambda Function to get the list of VMs from a VMware Cloud on AWS SDDC. As of now the AWS Code Editor doesn’t support writing or editing PowerShell based Lambda functions. The steps discuss how to create the Lambda functions offline and deploy them in AWS Lambda.
The Lambda functions in PowerShell require PowerShell Core 6.0, Windows PowerShell isn’t supported. If you have PowerShell Core 6.0 or above already installed, skip to step 2. The environment variable $PSVersionTable will help you to find the PowerShell version and Edition.
I’ve used Powershell Core v6.2.1 which can be downloaded from PowerShell GitHub repo.
1.2 Once downloaded, double-click the installer and follow the prompts.
Step 2 : Install .NET Core 2.1 SDK.
Because PowerShell Core is built on top of .NET Core, the Lambda support for PowerShell uses the same .NET Core 2.1 runtime for both .NET Core and PowerShell Lambda functions. The .NET Core 2.1 SDK is used by the Lambda PowerShell publishing cmdlets to create the Lambda deployment package. The .NET Core 2.1 SDK is available at .NET downloads on the Microsoft website. Be sure to install the SDK and not the runtime installation.
Open PowerShell Core and run the following command to install ‘AWSLambdaPSCore’ module.
Install-Module AWSLambdaPSCore -Scope CurrentUser
The following are the commands available in module ‘AWSLambdaPSCore’
Step 4 : Install PowerCLI
If you already have PowerCLI modules installed in Powershell Core, skip this step.
Open PowerShell Core and run the following command
Install-Module VMware.PowerCLI
Step 5 : Create script from PowerShell Lambda Templates.
AWSLambdaPSCore module provides some Script Templates. Get-AWSPowerShellLambdaTemplate will list out the available templates.
We will use the template ‘Basic’ to create script ‘VMC-GetVM.ps1’ for getting the VM list from VMC SDDC.
Step 6 : Modify the script to get the VMs from vCenter located VMConAWS SDDC.
If you are new to Powershell Lambda its good to go through this articleto understand Input Object, Returning Data, Additional Modules and Logging.
Open the script VMC-GetVM.ps1 in the editor, I use VSCode. Replace the content of the script with the following script.
Note: Please ensure the version of modules marked with #Requiresstatement are same as the version of modules loaded in Powershell Core. If it’s different, then update the script with version details of corresponding modules which are loaded. The following command will help to find the versions of required modules.
The values for the properties (venter, vCenterUser, etc) in the object $LamdaInput will be passed when we execute the function.
# PowerShell script file to be executed as a AWS Lambda function.
#
# When executing in Lambda the following variables will be predefined.
# $LambdaInput - A PSObject that contains the Lambda function input data.
# $LambdaContext - An Amazon.Lambda.Core.ILambdaContext object that contains information about the currently running Lambda environment.
#
# The last item in the PowerShell pipeline will be returned as the result of the Lambda function.
#
# To include PowerShell modules with your Lambda function, like the AWSPowerShell.NetCore module, add a "#Requires" statement
# indicating the module and version.
#Requires -Modules @{ModuleName='VMware.VimAutomation.Sdk';ModuleVersion='11.3.0.13964823'}
#Requires -Modules @{ModuleName='VMware.VimAutomation.Common';ModuleVersion='11.3.0.13964816'}
#Requires -Modules @{ModuleName='VMware.Vim';ModuleVersion='6.7.0.13964812'}
#Requires -Modules @{ModuleName='VMware.VimAutomation.Cis.Core';ModuleVersion='11.3.0.13964830'}
#Requires -Modules @{ModuleName='VMware.VimAutomation.Core';ModuleVersion='11.3.0.13964826'}
# Uncomment to send the input event to CloudWatch Logs
#Write-Host (ConvertTo-Json -InputObject $LambdaInput -Compress -Depth 5)
$vCenter = $lambdainput.vCenter
$vCenterUser = $lambdainput.vCenterUser
$vCenterPassword = $lambdainput.vCenterpassword
Connect-VIServer $vCenter -User $vCenterUser -Password $vCenterPassword
$vmlist = get-vm
Write-Host $vmlist.Name
Save the script.
Step 7 : Reduce the size of package
In next step we will publish the Lambda Function. While publishing, a deployment package that contains our PowerShell script ‘VMC-GetVM.ps1’ and all modules declared with the #Requires statement will be created. But the deployment may fail since the package with listed PowerCLI modules will exceed Lambda’s hard limit on Package size, ie 69905067bytes. In that situation the following error will be thrown.
To avoid that, as a workaround, we’ve to reduce the package size by cutting down the size of PowerCLI modules. When I checked ‘VMware.VimAutomation.Core’ is the largest module which is due to Remote Console files included in the module.
Browse to the following path and move the folder ‘VMware Remote Console’ to Documents.
I was in search for a script to generate report on vCPU to pCPU ratio and vRAM to pRAM at cluster level in a vCenter. Found couple of interesting community threads which address part of the requirements. Thought to consolidate (or extract:) ) the code and created the following. The report will be generated as CSV file.
Customer requested to increase the windows volume T:. The mentioned volume is a RAW LUN located in EMC VMAX storage. To expand the LUN storage team needs NAA ID (or WWN) of the LUN.
Its easy to find the naa id of a LUN from windows Guest OS with the help of EMC’s Inquiry (inq) tool. Please find the steps below to fetch the naa id with inq tool.
Steps:
Download the inq tool to the VM from following hyperlink.
Once the configuration on Cisco VIC adapter is done, we need to do certain configuration settings on Nexus switch to enable VM-FEX. In this section we discuss more on the configuration settings that needs to be done specifically on on Nexus 5000 Series switch to enable VM-FEX. We also discuss on settings that needs to be done on ESXi to enable VMFEX.
A VM-FEX license is required for Cisco Nexus device. The license package name is VMFEX_ FEATURE_PKG. Incase if you are just interested in experimenting with this cool feature, a grace period of 120 days starts when you first configure this feature.
We have to do the following configuration on Nexus 5000 switch:
Enable VM-FEX and other related services
Define port profiles for dynamic Virtual Machine ports
On Monday VMware announced the complete list of vExpert 2014. This year 754 people were named as vExpert. I am one among them!! humbled!!.
For those unknown with the term: “vExpert” is not a technical certification or a general measure of VMware expertise. The annual VMware vExpert title is given to individuals who have significantly contributed to the community of VMware users over the past year. The title is awarded to individuals (not employers) for their commitment to sharing their knowledge and passion for VMware technology above and beyond their job requirements. Here is the complete list of vExperts 2014.
If you feel you have contributed to the VMware community and did not apply for vExpert, good news.. the Q2 applications are already open at http://www.jotformpro.com/form/40285638168967. Good luck!
Its always a time consuming job to find out the LUN is FREE, RDM or VMFS. The following script will help to get the details of LUNs from hosts in a cluster and will tell us the LUN is VMFS, RDM or FREE.
If the LUN is an RDM, we can see on which VM RDM is mapped. And if the LUN has VMFS volume, the datastore name will be displayed. Also the script provides the details like LUN number, Capacity and naa id (Canonical Name).
The CSV file that is produced by the script looks like this. In this example cluster has four hosts (esx1,esx2,esx3 and esx4), four LUNs (0,1,2 and 13) are shared among them.
1. Report will be sent as e-mail in HTML format.
2. Added Hyperlink to the vCenter Web Client to login.
3. Each VM will have the Hyperlink to the corresponding VM Console.
The output that is produced by the script looks like this
Notes:
1. Hyperlinks will work only on vCenters with vSphere version 5.1 or above. Continue reading →