Pages

Tuesday, November 28, 2017

Associate UTAG with VM on Secondary NSX Managers.

Here is the API call you can use on the Primary NSX Manager to assign tags to VMs (which could also be running on the secondary):

POST /api/2.0/services/securitytags/tag/{tag-id}/vm?action=attach

The request body will depend on the Unique ID selection criteria. If you are using instance UUID use:

<securityTagAssignment>
  <tagParameter>
    <key>instance_uuid</key>
    <value>a702c039-fb86-4c5f-b8f4-1c2d80299c97</value>
  </tagParameter>
</securityTagAssignment>

You can determine the appropriate security tag-id using:


GET /api/2.0/services/securitytags/tag

Thursday, November 9, 2017

ESXi host script - list all VM files and check lock status

VM=DLR
VMX=`esxcli vm process list | grep -A 6 $VM | grep "Config" | cut -c 17-300`

egrep "\.vmdk|\.vswp|\.vmx|\.vmxf|\.log" $VMX | cut -d "\"" -f 2 > /tmp/files.txt

for cf in `cat /tmp/files.txt`; do
    echo "the next config file is $cf"
    vmfsfilelockinfo -p $cf -v 192.168.4.100 -u administrator@uw.cz
done



Jeste je potreba doladit cesty k souborum, ktere jsou relativni a ne absolutni.

Saturday, November 4, 2017

Windows vCenter 5.5/6.0 upgrade/migration to VCSA 6.5

VMware clearly announced that windows based vCenter server is deprecated and future versions will be released only as a virtual appliance known as vCenter Server Appliance (VCSA). I have helped one of my customers with upgrade / migration of their vCenter 5.5 to 6.5 and I have documented few points which can be useful for others.

Before migration following points should be validated
  • All ESXi hosts managed by old vCenter must be at least 5.5 because ESXi 5.1 is not supported by vCenter 6.5 
  • All external solutions previously integrated with vCenter must be compatible with vCenter 6.5 
Migration process
  1. If you want migrate VMware Update Manager (VUM) configuration you must run migration assistant on VUM windows server. We have experienced some issues with VUM migration therefore we have decided to unregister VUM (VUM extension name = com.vmware.vcIntegrity) and continue with vCenter migration without VUM data migration. 
  2. Unregister all external vCenter extensions like (SRM, vSphere Replication, Backup Softwares, Storage Extensions, etc.) which must be registered later back to new vCenter (VCSA)
  3. Run Upgrade/Migration assistant on Windows where vCenter service is running
  4. Run Upgrade/Migration wizard on administrator workstation and follow upgrade wizard
  5. If vCenter is joined into Active Directory, Migration Wizard ask you for AD account which is used to join new VCSA 6.5 host into AD. AD account is entered without domain so account DOMAIN\USER must be entered only as USER.
Stages of data migration from source to target vCenter (approx. 35 minutes)
  • 41% - Exporting VMware vCenter Server data - this is the most time consuming part of data migration and progress bar is the whole time in 41% 
  • 42% - vCenter Orchestrator data 
  • 50% - vCenter Authentication Framework
  • 50% - Shutting down source machine 
  • 75% - Applying Active Directory configuration
  • ??
Setup target vCenter Server and services
  • 2% - Starting vCenter Authentication Framework
  • 5% - Starting VMware Identity Management Service
  • 17% - Starting VMware Component Manager 
  • 20% - Starting License Manager
  • 25% - Starting VMware ervice Control Agent
  • 28% - Starting VMware API Endpoint
  • 31% - ???
  • 45% - Starting VMware Postgres - takes a long time
  • ??% - Starting Web Client
  • 62% - Starting vCenter Server
  • 65% - Starting Content Library Service
  • 68% - Starting ESX Agent Service
  • 77% - Starting VMware Update Manager
  • 80% - Starting vCenter High Availability
  • 85% - Starting VSAN 
  • 97% - Starting Vmware performance Charts
  • 100% - ???
Importing copied data to target vCenter Server
  • 14% - Importing Vmware vCenter Inventory Service data
  • ??
  • 50% - Import vSphere Web Client data
  • ??
After migration
  • If you upgraded from vCenter 5.5 you do not have vCenter 6.5 license therefore you have to upgrade your 5.5 license to 6.x on my.vmware.com license portal
Conclusion



We have migrated just vCenter inventory without Events and Performance data. Source vCenter inventory had approx. 1700 virtual machines and around 65 ESXi hosts and the whole migration took 70 minutes. It is not bad if you ask me.

Friday, October 27, 2017

vCenter TCP/UDP ports




ServicePortNotes
vCenter Server 443• Listens for connections from the vSphere Web Client
• Monitors data transfer from SDK clients
Platform Services Controller (PSC)389, 636• LDAP port number for the Directory Services for the vCenter Server and PSC
• Single Sign-On LDAPS
DNS53• Resolves on-prem Identity Source and PSC from VMC
Active Directory / OpenLDAP389, 636, 3268, 3269• Identity Source used for HLM 
• Configured in VMC vSphere Client
ESXi902, 903• Host access to other hosts for migration and provisioning 
• Status update (heartbeat) connection from ESXi to vCenter Server
• Remote console traffic generated by user access to virtual machines on a specific host
• Required for cold migration

Wednesday, September 13, 2017

x86 boot proces FreeBSD


Mozna bude jednodussi, kdyz, co mozna strucne, popisu jak takovy boot vlastne vypada. Pro jednoduchost se budu venovat pouze klasickemu BIOSu a nikoliv UEFI firmware.

1. BIOS nainicializuje zakladni desku s prislusenstvim a pristoupi k bootovani operacniho systemu - z jakeho zarizeni se pokusi system nabootovat je zalezitosti konfigurace BIOSu. Pro jednoduchost budeme vybranemu bootovacimu zarizeni rikat systemovy disk.

2. BIOS precte obsah prvniho sektoru systemoveho disku, okontroluje, ze na pozicich 510 a 511 jsou hodnoty 55h a AAh (takzvana "boot signature", znamka toho, ze obsah sektoru je platny), placne ho do pameti a preda rizeni programovemu kodu na zacatku sektoru. A co se bude dit dal je uz zalezitosti toho kodu.

Uz jen FreeBSD dava na vyber dve varianty co do tohoto sektoru dat. "Klasicky" a FreeBSD interaktivni. V trifazovem bootovani, ktere je pro FreeBSD typicke, je toto faze 1.

3a. klasicky kod prohrabe partition table, ktera je v tom sektoru taky, najde prvni aktivni partition, z ni precte precte prvni sektor, okontroluje, ze je platny, flakne ho do pameti a preda mu rizeni

3b. Interaktivni, z partition table a dalsich kofniguracnich informaci, ktere ma v sektoru ulozene vytvori "seznam kandidatu", necha z nich uzivatele vybrat (to je ten Fn... prompt), z vybraneho oddilu precte precte prvni sektor, okontroluje, ze je platny, flakne ho do pameti a preda mu rizeni.

Pokud se systemovy disk jmenuje ada0, pak jednotlive partition jsou s1..s4 a mluvime tedy o precteni prvniho sektoru z, napriklad, ada0s1

4. V pripade, ze partition vybrana (v 3a nebo 3b) je FreeBSD, pak ma na zacatku BSDLABEL - a jeji soucasti je znovu kod, ktery se po jeho umisteni do pameti spusti udela velmi podobnou vec co kod z MBR. Kod tabulku, ktera oddil dale deli (oddily oznacene pismenky - a,b,c,d,...) a vybere, ktera z nich bude bootovaci. Tady se na zadne "active" nehraje, tenhle kod si "konfiguraci" precte v souboru /boot.config, krome toho je interaktivni (FreeBSD/x86 boot) takze ho muze ovlivnit i uzivatel. Vysledkem rozhodovaciho procesu je "co a odkud natahnout dal".

To o cem ted mluvim je "faze 2".

Natahnout se da ledacos z ledakdes, obvykle to ale je /boot/loader z oddllu 'a'. A pote co se natahne mu je predano rizeni. Tim vstupujeme do faze 3.

5. Loader za pouziti informaci v /boot/loader.conf a pripadne take dalsich vcetne interaktivniho vstupu uzivatele (menu a/nebo prompt) rozhodne co natahne a odkud. Typicky /boot/kernel/kernel - ten se natahne a preda se mu rizeni, cimz je okonceno zavadeni systemu a zacina jeho vlastni beh.

Dobu kdy bezel kod 'loader' hovorime o fazi 3.

No a to je ze zakladu vsechno. Ano, da se to komplikovat - napriklad vynechavat faze (fyzicky disk muze rovnou zacinat BSDLabel a nemit vubec zadnou MBR a navic nemusi natahnout /boot/loader ale klidne rovnou /boot/kernel/kernel) ale ja myslim, ze to je komlikovay dost i bez toho ;-)

Ted bys uz mel tusit jak se v jednotlivych fazich vybira "kudy dal" a jak teda dosahnout toho, co potrebujes.

Thursday, July 6, 2017

Ach ti mladi

 „Naše mládež je nevychovaná, vysmívá se autoritám a nemá žádný respekt ke starcům. Naše děti dnes nevstávají, když vstoupí do místnosti kmet, odmlouvají rodičům a místo práce se vybavují. Jsou docela prostě špatní.“ Sokrates (469-399 př. Kr.)

„Ztrácím veškerou naději v budoucnost naší země, pokud ji zítra povede dnešní mládež, protože tahle omladina je nesnesitelná, nezkrotná, prostě strašná.“ Hesiodos (720 př. Kr.)

„Náš svět dosáhl kritického stadia. Děti už neposlouchají rodiče. Konec světa nemůže být daleko.“ Egyptský kněz (2000 př. Kr.)

„Tato mládež je prohnilá skrz naskrz. Mladí lidé jsou zlomyslní a leniví. Nikdy nebudou jako mladí kdysi. Ti dnešní nedokážou zachovat naši kulturu.“ Hliněná tabulka nalezená v troskách Babylonu, stará 3000 let