Skip to main content

Posts

Showing posts from 2017

Set Visual Studio Code (VS Code) Default Language Mode When New File Opened

Visual Studio Code is my default PowerShell script editor. It is free and available in Windows, macOS, and Linux.By default, it uses text as the script language when a new file is opened. To make it recognize the PowerShell cmdlet, I have to manually change the language mode (press F1, type Change Language Mode, then select PowerShell form the list of the language) or first save to the file to ps1. This becomes inconvenience overtime.Luckily, a new setting “files.defaultLanguage” is added. I didn’t backtrack when this setting was added. It’s available in the current release 1.14.0 as of this writing. To configure the default language setting, Open File, Preferences, SettingsAdd the following to set PowerShell as the default language mode“files.defaultLanguage": "powershell",Save the setting.json fileTo set other supported languages as the defaultDelete “powershell” in the linePress Ctrl + Spacebar to select the option from the list

Use WinSCP to Transfer Files in vCSA 6.5

To use WinSCP to transfer files with vCSA, VMware KB2107727’s solution is temporarily changing the default shell from appliancesh to bash, then changing back after the transfer. This works in vCSA 6.0 and vCSA 6.5.In vCSA 6.0, there is a tick to change the WinSCP’s Advanced, SFTP server setting to "shell /usr/lib64/ssh/sftp-server" (without the quotes) for file transfer without changing the default shell. See “Connect to vCSA using WinSCP”VMware changed the OS from SLES to Photon in vCSA 6.5. The above setting doesn’t work anymore. There is no ssh directory under /usr/lib64/. However, a quick search and find the sftp-server is moved to /usr/libexec/. Using the setting “shell /usr/libexec/sftp-server” in vCSA 6.5 works fine.Here is the detail instruction.Log in vCSA VAMI UI (https://vcsa-ip:5480)Under Access, enable SSH Login. (PS: enabling Bash Shell is not necessary)Open WinSCP, select File protocol: SFTPEnter the vCSA hostname, port number 22, root, and root’s passwordClic…

VCSA 6.5 “The appliance management service is not running” Fix

ScenarioIn vSphere Web Client 6.5, under Home, Administration, Deployment/System Configuration, Nodes, the vCenter Server node shows an error message “The appliance management service is not running”. An error message “HTTP response with status code 503, 503 Service Unavailable (Failed to connect to endpoint: _serverNamespace = /vmonapi action =Allow _port = 8900" also appears in the web client.TroubleshootingLogin the VMware Appliance Management UI (https://psc:5480 or https://vc:5480). All the health status are good.SSH to VC appliance. Check service status (KB2109887)# service-control –list# service-control –statusapplmgmt (VMware Appliance Management Service) is runningvmonapi (VMware Service Lifecycle Manager API) is not runningSolutionRestart vmonapi service or restart all services# service-control --start vmonapi# service-control –start –allPS: if restarting all the services, it may take some time before all services turn back to Good (green) in the node’s Summary page. e.…

VCSA 6.5 Syslog vs vRLI’s vSphere Integration

I write this post after reading William Lam’s “What logs do I get when I enable syslog in VCSA 6.5?” and doing some of my experiment on my VCSA 6.5 and vRLI 4.5 setup. BackgroundRecently I completed a fresh VCSA 6.5 (external PSC and VC) deployment with vRealize Operations Manager (vROPS) 6.6 and vRealize Log Insight 4.5 installation. In vROPS, I configured vSphere and vRLI solutions; in vRLI, I configured vSphere and vROPS integration. I thought I completed all the setup until reading William’s blog post.ConfusionThere are a lot of information on his blog post. I was a little lost at the beginning, and I was wondering: should I configure VCSA syslog to vRLI? Is the same as vRLI’s vSphere integration? If I read his blog carefully, I would find the answer there. I didn’t fully understand it until I did my own experiment. Here is the quote. I highlighted a few key points.I personally think the vSphere Integration is a nice solution if you have both Windows vCenter Server and the VCSA an…

vSphere 6.5 New Feature – VMware Orchestrated Restart

Let me back to the old ESXi 3 day – when I was just using the standalone ESXi hosts or vCenter without HA and DRS. In case of the power outage or air conditioning failure in the data center, all the ESXi hosts were powered down. Once the environment problem was resolved, I could manage the VM startup sequence by configuring the switched PDU to start the hosts accordingly, and configuring the VM startup order at the host level.However, once I deployed vCenter Server with HA and DRS, I lost the control of the VM startup order. Because the VMs could be hosted at any host in the cluster. Someone said that I should not worry about the VM startup order in the cluster. Because the ESXi cluster would never go down if I had designed the infrastructure with enough redundancy. As we all know, we never have enough redundancy in a small ESXi deployment.I have been curious why VMware do not “fix” this issue for so long. Until now, vSphere 6.5 introduces the VMware Orchestrated Restart feature. At t…

vSAN Performance Service “Hosts Not Contributing Stats” Fix

I have a four-host vSAN cluster running vSAN 6.2. Recently the vSAN health’s Performance service check shows two of the hosts not contributing stats. The following are all the steps that I tried during troubleshooting and ultimately fixing the issue in my environment. Some of the steps do not fix my issue, however they may be applicable to your situation. PS. I opened a VMware support case on this issue. The support engineer did not directly solve my issue. However, he did give the hint on the cause of the issue that led me to discover the solution.Turn off and turn on the Performance Services in vSphere web client, vSAN cluster, Manage, Settings, Health and Performance.Turn off the Performance Services, restart the vSAN management agent “/etc/init.d/vsanmgmtd restart”, then restart the service.Place the vSAN host in the maintenance mode and restart the host.SSH to the vCenter server appliance, restart the vmware-vpxd service “service vmware-vpxd restart”.Verify the vSAN storage provi…

vCenter Server 6.5 Native High Availability Feature Summary

Available exclusively for vCenter Server Appliance (vCSA) Consist of three nodes – active, passive, and witness nodes Passive and Witness nodes are cloned from the existing vCSA (active node)vCenter HA cluster can be enabled, disabled, or destroyed at any timeThere is a maintenance mode to prevent planned maintenance from causing an unwanted failoverUse two types of replication between active and passive nodesNative PostgreSQL synchronous replication for the vCenter Server database A separated asynchronous file system replication for key data outside the databaseTwo vCenter HA deployment workflows Basic: all vCenter HA nodes are deployed within the same cluster Advanced: the active, passive, and witness nodes are deployed to different clustersThere is little benefit to using vCenter HA without also providing high availability at the Platform Service Controller layerAn external Platform Services Controller instance is required when there are multiple vCenter Server instances in an…

New Year Resolution - Improve Productivity

Here is my another new year resolution in 2017 - improve productivity (see my previous 2017 new year resolution here. The source of these ideas are from http://www.businessinsider.com/bad-habits-that-killing-productivity-2016-12.Get out of the bed when the alarm clock buzzesGet enough sleepDo not keep the tablet next to the bed. I keep the smartphone next to the bed as my alarm clockDo not skip breakfast and drink some hot tea before going to the toilet in the morningComplete the hardest and most important tasks at the beginning of the dayDo not check email throughout the day, especially in the middle of the night. When wake up in the morning, only check if there is missing call or text message. Do not read the email until later of the dayDo not eat junk food or eat less junk foodFocus on 3 ~ 5 of the most important goals and ignore the restDo not sit all day and walk 50,000 steps in a weekDo not multitaskDo not skip the workoutDo not look up the answer of a random question that just …

Lessons from Security Breaches

Here are my short summary of the article “Learning From A Year of Security Breaches” that are applicable to most of work environments.Centralize logs, including host, application, authentication, and infrastructure, into as few system as possible; make critical logs alertable; but be aware of user privacy in what you logYou might not find the root cause of a beach because of weakness in the environment, systems or people; practicing incident response can indentify these weaknessAttackers will target employee’s home, personal email, or device to breach the corporate security; Educate your employees to improve their security practices and involve the corporate security team even if they have personal security issuesAvoid putting secrets and keys into source codeProtect employees’ credential by integrating Single Sing On or Multi Factor AuthenticationBe aware of insider threatsMeasure and eliminate the security debt - cutting corners for fast growth

First Day Result of Improving Sleep Quality

Here is the first day result of following my 2017 new year resolution - improve sleep qualityWent to bed at 10:2x p.m. According to my Fitbit, slept at 10:34 p.m. and woke up at 3:53 a.m., and time asleep 5 hours and 9 minutes with 10 minutes restless. I know I woke up at 2:19 a.m. and 3:24 a.m. to check the time on my Fitbit. Then I am fully awake from a dream at 3:24 a.m.Did not drink any sola the whole dayDrank half glass of water before going to bedDid not exercise the whole day, and walked 7,578 stepsShut down the computer at 10:1x p.m., did not read on the phone and tablet in bedKept the phone next to the bed as the alarm clock. When waking up, I checked if there is any phone call or text message (the anwers is no); I did not read any email even there are some on the phone.ConclusionGoing to bed at 10 p.m. may be too early for me. I may move to 10:30 p.m.When wake up, check for phone call or text message only. Do not read any email until 6 a.m. or the start of a normal day

New Year Resolution - Improve Sleep Quality

To improve the sleep quality in 2017, I have some plans (the source of these ideas from https://medium.com/personal-growth/how-to-wake-up-early-your-ultimate-blueprint-1f8bb2045b90)Sleep at least 6 hours and 30 minutes each day. I will go to bed at 10 p.m. except Saturday.Do not drink sola after 4 p.m. or 6 hours before bedtime. I do not drink alcohol and rarely drink coffee.Drink half glass of water before going to bedDo not exercise after 7 p.m. or 3 hours before bedtimeDo not read or watch on the smartphone, tablet, or computer after 9 p.m. or 1 hour before bedtime. This one will be difficult.Do not put the smartphone or tablet next to the bed