Ciao Fabio, Precisely what I want is as you mentioned! I would like to read the status of power from ESXi and than I could use them to shut down the VM and ESXi host itself. Second aim is to read ...
See more...
Ciao Fabio, Precisely what I want is as you mentioned! I would like to read the status of power from ESXi and than I could use them to shut down the VM and ESXi host itself. Second aim is to read the messages from agents so I can still rely on the UPS that reports to me that power failure occurs. So I dont want to decide only based on my readings from power status I also want to evaluate SNMP messages. But I would like to run to my targets one by one piece by piece Maybe good start would be reading power status of ESXi host. Or any other better approach is also welcome. Mille Grazie Volkan
Ciao Fabio, Sorry for my late reply, But I tried that RSA ssh key pairs thank you for the links. The most important thing to done in windows, you must create authorized_keys file from scratch in t...
See more...
Ciao Fabio, Sorry for my late reply, But I tried that RSA ssh key pairs thank you for the links. The most important thing to done in windows, you must create authorized_keys file from scratch in the right ssh folder. And the private key must be kept secret for example in our case we setted up a ssh passwordless connection from ESXi to a windows VM. so I created the key pairs in ESXi and copied public key content into authorized_keys file in Windows. Now it works perfectly i can ssh to VM from Esxi without prompted die password or user name. NOW I have new challanges. I always find new challanges for myself to perform the right solutions. 1. How can I read the power loss in ESXi exactly IDRAC reads power statuses . Idrac shows power status for both power inlets. So if can read those power inlets statuses I can create a logic that main power is lost. 2. How can I read SNMP messages broadcasted by 3rd party master agents to ESXi. When the power lost happens either apc schneider or ompron Power act pro master agents broadcasts snmp messages, so I am aiming to catch them into a script and combine them with my logic in item 1 (that reading power status of power inlets) I would be very happy if you can send me some information where I can find 1. How to read Power status of ESXi ? 2. How to catch SNMP messages in ESXi ? Best Regards
Hi Nouha, So the principal idea of you is that; you read the status of the power input of the esxi server. Is that right ? with the line vim-cmd vmsvc/power.getstate $config | grep -i "on" > /de...
See more...
Hi Nouha, So the principal idea of you is that; you read the status of the power input of the esxi server. Is that right ? with the line vim-cmd vmsvc/power.getstate $config | grep -i "on" > /dev/null 2<&1 STATUS=$ ? so the first line asks to the power and waits and answer and this answer is captured by STATUS =$ ? variable in the next line is that right ? so than you can start another script or some commands to turn of the vms and server itself. I have no experience in this vmsvc but looks like worth to learn it. In this scenario, no need to read the SNMP agent messages from UPS master agent. Actually my second question would also be, how can we read the SNMP messages broadcastetd by UPS ? so than we can start some other scripts in case we catch those messages. BR Volkan
Ciao Fabio, I will test tomorrow your recommendations. One month ago I tried to define RSA keys it did not work for me. My remote VM is windows VM unfortunately not linux. Of course we will comp...
See more...
Ciao Fabio, I will test tomorrow your recommendations. One month ago I tried to define RSA keys it did not work for me. My remote VM is windows VM unfortunately not linux. Of course we will comply with security regulations without comprimising security we still should perform the necessary steps Milla Grazie Volkan
Hi Fabio, I was in vacation therefore there was a break. I have found out that remote task schedule makes some progress. so remotely I can start scheduled task via command line command. Now I onl...
See more...
Hi Fabio, I was in vacation therefore there was a break. I have found out that remote task schedule makes some progress. so remotely I can start scheduled task via command line command. Now I only have a problem in VM ware to include ssh pass package. Because Vm ware does not have this package and I can not use this package. ssh pass is a linux package and of course vm ware is explicitly not any linux release. Because I want to login to remotely into a VM from Esxi and send a command through ssh pass. I would be happy if there is a work around for this problem automatically login to remote VM from Esxi
Ciao, I still suffering with the problem; I also read something like below the chances are; 1. I create an exe file basicall get-process id find the required process by name in the loop an...
See more...
Ciao, I still suffering with the problem; I also read something like below the chances are; 1. I create an exe file basicall get-process id find the required process by name in the loop and use the closemainwindow method. 2. The exe file I created in c# in windows10 environment and then copied that exe into windows server 2016 VM but it did not run there. I dont know the reason. 3.Last chance is when the VM initiates a shutdown process, we will recognize it and will terminate our runtime based on that. I am now searching why my exe does not work in windows sertver 2016 while it works in windows 10. below is the simpel code sniplet in C# which makes exactly the same job on line power shell script Power shell has the same as below
actually the CloseMainWindow() function returns True when I run it directly in the VM windows as shown in below picture When I run the same thing through SSH from ESXi it returns False as show...
See more...
actually the CloseMainWindow() function returns True when I run it directly in the VM windows as shown in below picture When I run the same thing through SSH from ESXi it returns False as shown in below picture I must find out what cause that, because it this case something should return from windows VM back to ESXi host ssh session, maybe it loose the value during this backward transmission. I dont know the root cause but I could found is as above black screen shot. It sound a challenging issue for me unless I dont find another method to close the runtime. CloseMainWindow function actuall does what it should do therefore I used that way. Otherwise Zenrt32 is not properly ends it suddenly terminates what we dont want actually, because there are some services have to be properly ended by Zenrt32 when we send cloasemainwindow() function to Zenrt32 br Volkan
Ciao Fabio, Some more steps as below; I must find out the error with closewindow.ps1 other wise I could create a text file in VM when connect from ESXi host with ssh as below Here I send a com...
See more...
Ciao Fabio, Some more steps as below; I must find out the error with closewindow.ps1 other wise I could create a text file in VM when connect from ESXi host with ssh as below Here I send a command ssh Administrator@192.168.8.5 'powershell.exe -c "C:\Scripts\Test.ps1" ' here I see the result in windows server 2016 VM I also run the closewindow.ps1 right in the windows VM and it worked as below command C:\Windows\system32>powershell "C:\Scripts\closewindow.ps1" here you can see I run the script in the background gray still Zenrt32 alive somehow I must run the script twice and than below so the Zenrt32 successfully endet in the windows VM , I expect the same result when I do it through SSH from ESXi
Ciao Fabio, Thanks a lot at least I am one more step closer to end the Zenrt32 now with your wonderful powershell accessing command line. The situation is as below but still I could not manage the ...
See more...
Ciao Fabio, Thanks a lot at least I am one more step closer to end the Zenrt32 now with your wonderful powershell accessing command line. The situation is as below but still I could not manage the perform remote powershell commands properly Here I could get the process id of Zenrt32 which runs in the VM .. The connection was a putty connection to ESXi Host and from ESXi host I could make an SSH to Windows VM Here I have created a script called closewindow.ps1 to be able to terminate the Zenrt32, (actually in the VM I can run this script in poweshell and it does what it should do I mean could terminate the Zenrt32) But this script has to be run with below command ssh Administrator@192.168.8.5<password> 'powershell -c C:\scripts\closewindow.ps1' when I perform it nothing happens in VM but no error also I got in the putty ssh session to VM command here is performed unfortunately no result has been taken. Thank you Volkan
May I ask another ssh question ? that is not related with original problem but still its a side problem. The problem is when make an SSH to my VM windows server 2016, I can only run the script whi...
See more...
May I ask another ssh question ? that is not related with original problem but still its a side problem. The problem is when make an SSH to my VM windows server 2016, I can only run the script which includes command line command. I can not run a powershell script, it seems like doing nothing So as a brief: command line commands like TASKKILL works fine but if I use some poweshell commands such as Get-Process Zenrt32 | Foreach-Object { $_.CloseMainWindow() | Out-Null } | stop-process –force it does not work and no error message just seems like it does not doing anything
Ciao Fabio, That was great help from you side. Thank you very much and now I am in already as you may see in below screen shot So in this screenshot I made SSH RuntimeUser@192.168.8.5 and final...
See more...
Ciao Fabio, That was great help from you side. Thank you very much and now I am in already as you may see in below screen shot So in this screenshot I made SSH RuntimeUser@192.168.8.5 and finally from ESXi root I logged in to VM where windows server 2016 runs. Thanks again and wish you a great day BR Volkan
Ciao Fabio, SSH is enabled however in ESXi 6.7 it locates in another place, please see the screen shot very bottom of this message Thank you for your answer, actually my ESXi is 6.7 and does not lo...
See more...
Ciao Fabio, SSH is enabled however in ESXi 6.7 it locates in another place, please see the screen shot very bottom of this message Thank you for your answer, actually my ESXi is 6.7 and does not look like the screenshot that you send it. Unfortunately there is no such setting available in my ESXi host. I also added some screenshots as below on the left black screen you can see that from a centos os I can make an SSH to my ESXi host on the other hand from ESXi host I can not start an SSH to that centos OS which is on the right black screen says "connection timed out"
Hi All, ESXi 6.7 U2 There are two VMs running on this ESXi 1. VM Windows server 2016 2.VM Centos 8 I need to make an SSH from ESXi to for example windows server VM... an example would be [ro...
See more...
Hi All, ESXi 6.7 U2 There are two VMs running on this ESXi 1. VM Windows server 2016 2.VM Centos 8 I need to make an SSH from ESXi to for example windows server VM... an example would be [root@ESXi-Host:~] ssh MyUser@192.168.8.35 When I perform this command it ends up with connection timed out. The Firewall is totally off in both VMs I can for example make an SSH from Centos to the ESXi but the opposite does not work Is there any idea, how can I access the VMs from ESXi with SSH ? My Main purpose is to end one of the application running in the windows VM by a script runs in ESXi host. Actually I am planning to have SSH access to windows VM and end the known process. (SSH in ESXi is of course enabled not required to tell)
Hi in my case, TSM SSH policy keeps the setting as start, stop with host eventhough I changed it to Manual start stop.. I have no clue how to revert back this policy setting. Seems like this setti...
See more...
Hi in my case, TSM SSH policy keeps the setting as start, stop with host eventhough I changed it to Manual start stop.. I have no clue how to revert back this policy setting. Seems like this setting is overwritten in somewhereelse.
Hi all, I have similar problem, kind of opposite. Just I changed in the policy start with host and now i can not put it back to manual- Whenever I start the server this service starts because pol...
See more...
Hi all, I have similar problem, kind of opposite. Just I changed in the policy start with host and now i can not put it back to manual- Whenever I start the server this service starts because policy is overwritten somewhere else that I dont know. Br Volkan