ESXI: How to power on-off vms via cli

To power on a virtual machine from the command line:
List the inventory ID of the virtual machine with the command:

vim-cmd vmsvc/getallvms |grep <vm name>

Note: The first column of the output shows the vmid.

Check the power state of the virtual machine with the command:

vim-cmd vmsvc/power.getstate <vmid>

Power-on the virtual machine with the command:

vim-cmd vmsvc/power.on <vmid>

VMWare: How to add RDP rule to esxi firewall via cli

Sometimes I need to ssh jump to esxi host and tunnel RDP to an internal host across the ssh session

Backup:
cp /etc/vmware/firewall/service.xml /etc/vmware/firewall/service.xml.bak

chmod 644 /etc/vmware/firewall/service.xml

chmod +t /etc/vmware/firewall/service.xml

vi & enter towards the bottom of service.xml (below 0037):

<!– MY RDP –>
<service id=’0038′>
<id>myrdp</id>
<rule>
<direction>outbound</direction>
<protocol>tcp</protocol>
<porttype>dst</porttype>
<port>3389</port>
</rule>
<enabled>false</enabled>
<required>false</required>
</service>

chmod 444 /etc/vmware/firewall/service.xml

esxcli network firewall refresh

esxcli network firewall ruleset list

esxcli network firewall ruleset set -e true -r myrdp

Now feel free to RDP via ssh tunnel. I usually disable the rule after via:

esxcli network firewall ruleset set -e false -r myrdp

How to power off an unresponsive vm via cli

From: https://www.vladan.fr/esxi-5-unresponsive-vm-h/

Step 1 – connect via SSH by using puty for example and enter esxtop.

Enter “esxtop”, then press “c” for the CPU resource screen and shift + V to display VMs only.

ESXi 5 Unresponsive VM

Step 2 – changing the display and locating the LWID number

Press “f” to change the display fields and press “c” in order to show the LWID (Leader World Id) and press ENTER.

How to kill unresponsive VM in VMware ESXi 5

Step 3 – Invoking the k (kill) with the number does it…..

Now when you have the LWID column there, you can see the VM which interests you by the LWID number.

You can press “k” and enter the LWID number of the VM which you want to stop. Note that this is hard stop so, the next time that the VM will boot you’ll probbably see this screen (depending on your guest OS of course).

VMware ESXi 5 – How to kill an unresponsive VM through command line

If this method don’t work, you can’t vmotion the VM elsewhere or any other option don’t work either, there might be a hardware problem with the host which can lead into PSOD.

VMWare CLI: List VM’s, power on/off from cli and resize from cli

# vim-cmd vmsvc/getallvms
Vmid Name File Guest OS Version Annotation
1 QMain [ESX03] QMain/QMain.vmx windows8Server64Guest vmx-10
2 exch01 [ESX02] exch01/exch01.vmx winNetStandardGuest vmx-10
3 rdp01 [ESX02] rdp01/rdp01.vmx winNetStandardGuest vmx-10
4 VC02 [ESX01] VC02/VC02.vmx windows7Server64Guest vmx-10
5 tts1 [ESX01] tt1/tts1.vmx winNetStandardGuest vmx-10

~ # vim-cmd vmsvc/power.getstate 4
Retrieved runtime info
Powered off

~ # vmkfstools -X 100G /vmfs/volumes/ESX01/VC02/VC02.vmdk
Grow: 100% done.

~ # vim-cmd vmsvc/power.on 4
Powering on VM:

~ # vim-cmd vmsvc/getallvms
Vmid Name File Guest OS Version Annotation
1 QMain [ESX03] QMain/QMain.vmx windows8Server64Guest vmx-10
2 exch01 [ESX02] exch01/exch01.vmx winNetStandardGuest vmx-10
3 rdp01 [ESX02] rdp01/rdp01.vmx winNetStandardGuest vmx-10
4 VC02 [ESX01] VC02/VC02.vmx windows7Server64Guest vmx-10
5 tts1 [ESX01] tts1/tts1.vmx winNetStandardGuest vmx-10
~ #

Enable service in VMWare ESXI firewall

To list your current configuration:
# esxcli network firewall ruleset list

To enable sshClient to enable copying using ssh:

#esxcli network firewall ruleset set -e true -r sshClient

For older esxi versions (5 and below)
# esxcli network firewall ruleset set –ruleset-id sshClient –enabled yes

To refresh the configuration:
# esxcli network firewall refresh

Linksys Velop: Better home Wifi

If you’re in the market for simple to setup sleek home wifi mesh network with blazing speeds with coverage up to 6000 sq. ft, look no further! You need to checkout the Linksys Velop Tri-band Whole home Wifi Mesh System.  We just installed this in one of our clients homes and setup was extremely easy. If you are not computer savvy, you will have no problem setting this up. Another nice feature is You can use the nodes as a wireless to ethernet bridge to plug directly into if needed.

Setup is simple via an APP on your phone!

Pros:
– SUPER fast
– Dedicated “backhaul” channel for talking between nodes.
– Extremely easy setup (Download app on your phone, plug in devices and go)
– Sleek/Attractive design
– No external ugly antennas
– HUGE range and blankets your entire home in super fast wifi

Cons:
– No advanced features like DHCP range adjust or specific IP reservation through Mobile App
– Mobile App only (There is a web app for advanced features)

Shadow an RDP session

I was working on migrating VM’s via Hyper V cluster failover remotely, and a college asked if there was a way to Shadow. We tried both connecting to 1 host via logmein with no luck. I searched and found a way to shadow via RDP.

1.) I was log’d host via logmein (could easily be RDP)
2.) I then created another domain admin user called test since I was on as administrator. They logged into another host on the same network via logmein as the test user
3.) Then they RDP’d as the user test to the server I was logged into as administrator
4.) I opened remote desktop services manager and looked to see the session number administrator was logged in as (it was session 3)
5.) They opened command prompt (right clicked run as administrator). In the command prompt they typed: shadow 3
6.) I was prompted “Do you want to relinquish control” which I did.
7.) They could then see my desktop and do whatever in it, but I couldn’t see
8.) I X’d out and reconnected and we were golden.
9.) + stops the shadow

For more info, see: http://support.microsoft.com/kb/278845

#Windows #RDP

Issue with Barracuda Spam firewalls and Cisco PIX/ASA

I was working on a client’s barracuda to receive mail directly through the barracuda rather than their current setup.

I was able to remove it from the ASA adding the following to the config via cli: no fixup protocol smtp 25

For more on this you can read: https://blogs.it.ox.ac.uk/networks/2009/11/26/cisco-firewall-smtp-fixup-considered-harmful/

 

(1) “Why can’t anyone send mail to my Barracuda Spam & Virus Firewall over TLS, even though I have it enabled?”
—————————————————————————-

Solution #00003659

Scope:
All Barracuda Spam & Virus Firewalls in use with Cisco network hardware, all firmware versions.

Answer:
If enabled, the Barracuda Spam & Virus Firewall will advertise TLS (secure connection availability) for all incoming SMTP connections (for information on configuring this, see Solution #00000992). It’s possible the sending mail servers aren’t electing to send mail over TLS.

 

If it’s been configured correctly and the sending servers are trying to send mail over TLS, the problem could be that a device between the sending servers and the Barracuda Spam & Virus Firewall is interfering. For instance, a Cisco PIX firewall with the “SMTP Fixup protocol” enabled will mask the 250-STARTTLS echo reply from the Barracuda Spam & Virus Firewall, preventing the sending mail server from realizing that sending mail using a secure connection is an option. The only solution in this case is to disable the “SMTP Fixup protocol” on the Cisco PIX firewall (for instructions on how to do this, click here).

 

Cisco ASA firewalls may also interfere with the 250-STARTTLS SMTP response, but they can be explicitly configured to support ESMTP over TLS. If you are using a Cisco ASA firewall, click here for instructions on how to enable this functionality.

 

Additional Notes:

The Cisco PIX “SMTP Fixup protocol” can cause other problems when used with the Barracuda Spam & Virus Firewall. For more information, see Solution #00001728.

 

Link to This Page:
http://www.barracuda.com/kb?id=50160000000HQ7J