poniedziałek, 11 maja 2020

Jak sprawdzić hash MD5 (lub inny) w systemie Windows?

W systemach z rodziny Microsoftu mamy narzędzie certutil. Sprawdzenie hash MD5 jest proste, wydajemy komendę:
certutil -hashfile scieżka\do\pliku MD5
Zamiast MD5 możemy wybrać również inny algorytm, np SHA1 lub SHA256
Nadawanie uprawnień domenowych na hoście ESXi:
W konsoli hosta wydać komendę:
esxcli system permission set -g -i 'domena\user' -r Admin

Listowanie uprawnień:
esxcli system permission set

środa, 2 stycznia 2019

vCenter Converter 6.2 i error 1053

Dzisiaj próbowałem zainstalować vCenter Convertera. Niestety przy próbie uruchomienia wciąż wyskakiwał błąd: "Error 1053: The service did not respond to the start or control request in a timely fasion". Po krótkich poszukiwaniach okazało się, że jest to znany błąd występujący w sytuacji, kiedy instalujemy Convertera na maszynie bez dostępu do internetu:
https://docs.vmware.com/en/vCenter-Converter-Standalone/6.2/rn/conv_sa_62_rel_notes.html#knownissues
W sekcji Known Issues znajdziemy wszelkie informacje na temat błędu 1053.
  • Converter Standalone fails to start when installed on a computer without internet access
    After you install Converter Standalone on a computer without internet connection, Converter Standalone services fail to start. The following message is displayed:
    Error 1053: The service did not respond to the start or control request in a timely fashion.
    This issue occurs because the DNS server is not able to resolve host names online and the file integrity check exceeds the default timeout of 30 seconds due to failed access to public certificate authority stores.
    Workaround:
    Open HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control in the Windows Registry Editor and create or modify a ServicesPipeTimeout DWORD32 decimal value to at least 300000 (5 minutes). Restart the system for the changes to take effect.

czwartek, 9 sierpnia 2018

Probem z generowaniem nowych certyfikatów self-signed w vSphere Replcation 6.1

Pewnego dnia musiałem wystawić nowe certyfikaty self-signed, gdyż stare wygasały. Operacja wykonywana była na jednym z dodatkoych appliance vSphere Replication w wersji 6.1.2.14752 Build 5082273.
Natknłąem się na dwa problemy, pierwszy z nich dotyczył problemu z wyświetleniem informacji o aktualnym certyfikacie: "Unable to obtain certificate summary: Could not access keystore: /opt/vmware/hms/security/hms-keystore.jks". Drugi problem dotyczył usługi VRM, która nie chciała sie uruchomić po wygenerowaniu nowego certyfikatu. "Startup Configuration
Self-signed certificate installed successfully. Warning: Bad service status: Service not running"
Po kliknięciu Save and Restart Service: "no element found: line 1, column 0"
Przed opisanymi poniżej krokami wykonałem snapshoty odpowiednich serwerów.
Zacznijmy od problemu z widocznością certyfikatu. W zakładce VRS/Security widzimy:


Jak widać brak tu jakichkolwiek informacji o certyfikacie.
Do odważnych świat należy, więc wygenerowałem nowy certyfikat w zakładce Configuration:


Po wygenerowaniu certyfikatu zostałem wylogowany z appliance. Próba ponownego zalogowania nie powiodła się z oczywistej przyczyny: certyfikat został zmieniony. Po odświerzeniu strony zaakcepowałem nowy certyfikat i zalogowałem się bez problemu. Tym razem informacja o certyfikacie była widoczna:


Następnym krokiem było ponowne podłączenie appliance z poziomu vCenter. Nie ma co się z tym spieszyć, serwis HMS potrzebyje chwili czasu na restart, więc jeśli natkniecie się na błąd: "Cannot establish a TCP connection to server at 'IP_ADDR:8123'. Cause:
A generic error occurred in the vSphere Replication Management Server. Exception details: 'java.net.ConnectException: Connection refused (Connection refused)'." po prostu należy odczekać minutę lub dwie przed ponowną próbą podłączenia appliance. Appliance podłączamy w web cliencie. Zaznaczamy vCenter i w zakładce Manage wybieramy vSphere Replication. Kilkamy Replication Servers i po zaznaczeniu konkretnego serwera klikamy "Reconnect the selected vSphere Replication server"



Operacja podłączenia appliance moze chwilę zająć, u mnie task wisiał na 97% przez kilka minut.



Po odświerzeniu widoku appliance był w statusie Connected


Z drugim problemem zwróciłem się do supportu. Rozwiązanie okazało się proste, należało appliance wyłączyć i włączyć ponownie. Restart nie załatwia problemu, należy wykonać HARD power-off! Poniżej szczegóły podane przez support:

Symptoms
  • Unable to re-register the vSphere Replication Appliance.
  • Receive VAMI error as no element found: line 1, column 0.
  • Missing or corrupted ovfEnv.xml file.

Cause
This issue can be caused due to one of the following reason,
  • Replication appliance is removed and re-added to the environment.
  • Replication appliance is powered on directly from an ESXi host via either (direct host HTML Client or C# client).


Impact / Risks
  • Console of the replication appliance is unable to connect to the environment.
  • The ovfEnv.xml file of the replication appliance is empty or corrupt.
  • Loss of the appliance.

Resolution
This is a known issue.
Currently, there is no solution.

Workaround
To workaround this issue, vSphere Replication appliance requires a (HARD power-off) Full shutdown of appliance from client and then requires to be powered on via the web-client only.

Note: 

  • Whenever you perform a hard power-off of the appliance the ovfEnv.xml file will be refreshed and it will re-populate the information during the booting process.
  • In certain scenarios performing hard power-off and power-on more than twice has fixed the issue as well.
  • If the above action does not succeed in re-registering the appliance or the xml file is not repopulated then you have to re-deploy the appliance from scratch.

czwartek, 2 sierpnia 2018

Praca z plikami maszyny wirtualnej bez dostępu do sieci

Jeśli z jakichś powodów nie mamy dostępu do sieci maszyny wirtualnej, a chcielibyśmy pobrać lub umieścić jakiś plik na takiej maszynie, z pomocą przychodzi nam polecenie powercli: Copy-VMGuestFile. Należy pamiętać o ty, że zadziałać możemy w ten sposób tylko, jeśli maszyna ma zainstalowane i uruchomione vmtoolsy. Przykładowe polecenie do skopiowania lokalnego pliku c:\temp\test.txt do katalogu c:\temp vmki (i na odwrót):

Z komputera lokalnego na vmkę
Copy-VMGuestFile -Source c:\temp\test.txt -Destination c:\temp\ -VM NAZWA_VM -LocalToGuest -GuestUser DOMENA\USER -GuestPassword HASŁO

Z vmki na komputer lokalny
Copy-VMGuestFile -Source c:\temp\test.txt -Destination c:\temp\ -VM NAZWA_VM -GuestToLocal -GuestUser DOMENA\USER -GuestPassword HASŁO

czwartek, 26 lipca 2018

Zarządzanie usługami w VCSA6

Wszystko opisane jest tutaj: https://kb.vmware.com/s/article/2109887, wypiszę tutaj najwazniejsze rzeczy ku pamięci:

Listowanie/sprawdzanie stanu usług:
service-control --list/status

Start/stop usługi:
service-control --stop/start

Należy oczywiście pamiętać o włączeniu shella w VCSA.

Na koniec tabelka z zesawieniem ugług w VCSA6 ze wspomnianego wyżej KB:

Service NameDescription
applmgmtVMware Appliance Management Service
vmware-cis-licenseVMware License Service
vmware-cmVMware Component Manager
vmware-eamVMware ESX Agent Manager
vmware-sts-idmdVMware Identity Management Service
vmware-invsvcVMware Inventory Service
vmware-mbcsVMware Message Bus Configuration Service
vmware-netdumperVMware vSphere ESXi Dump Collector
vmware-perfchartsVMware Performance Charts
vmware-rbd-watchdogVMware vSphere Auto Deploy Waiter
vmware-rhttpproxyVMware HTTP Reverse Proxy
vmware-scaVMware Service Control Agent
vmware-spsVMware vSphere Profile-Driven Storage Service
vmware-stsdVMware Security Token Service
vmware-syslogVMware Common Logging Service
vmware-syslog-healthVMware Syslog Health Service
vmware-vapi-endpointVMware vAPI Endpoint
vmware-vdcsVMware Content Library Service
vmafddVMware Authentication Framework
vmcadVMware Certificate Service
vmdirdVMware Directory Service
vmware-vpostgresVMware Postgres
vmware-vpx-workflowVMware vCenter Workflow Manager
vmware-vpxdVMware vCenter Server
vmware-vsmVMware vService Manager
vsphere-clientvSphere Web Client
vmware-vwsVMware System and Hardware Health Manager
vmware-vsan-healthVMware vSAN Health Service

środa, 25 lipca 2018