Showing posts with label VMware. Show all posts
Showing posts with label VMware. Show all posts

Tuesday, October 6, 2015

Vmware. Задание policy path для LUN-а в ESXi


Нужна всего пара команд.
Можно делать через vSphere CLI или напрямую через SSH консоль.
  1. Вывод списка подключенных LUN'ов (device)
    esxcli nmp device list
    Например:
    naa.600a0b80003ac474000006884b9ef497
        Device Display Name: DS3400_SQLTest
        Storage Array Type: VMW_SATP_LSI
        Storage Array Type Device Config: SATP VMW_SATP_LSI does not support device configuration.
        Path Selection Policy: VMW_PSP_MRU
        Path Selection Policy Device Config: Current Path=vmhba2:C0:T1:L20
        Working Paths: vmhba2:C0:T1:L20
  2. Задание path policy для LUN'а.
    Выбираем нужный LUN и берем его device id, например naa.600a0b80003ac474000006884b9ef497
    Выполняем команду
    esxcli nmp device setpolicy --psp VMW_PSP_MRU --device naa.600a0b80003ac474000006884b9ef497
    Здесь мы задали для девайса naa.600a0b80003ac474000006884b9ef497 path policy VMW_PSP_MRU, т.е. политику наиболее часто используемого пути.
Подробности читать в мауале vSphere Command-Line Interface Installation and Reference Guide стр. 85.
Читать до полного просветления и НЕ БАЛОВАТЬСЯ этой настройкой.
Один раз сделал - и НЕ ТРОГАЙ без ОЧЕНЬ веской причины!

Vmware. Flex x240. Первоначальная настройка UEFI для VMware ESXi

​Для VMware ESXi рекомендуется такие настройки UEFI:
  • System Settings
    • Operating Modes
      • Choose Operating Mode - Custom
      • Power/Performance Bias - OS Controlled
      • Memory Power Management - Disable
      • Memory Speed - Max Performance
      • Turbo Mode - Enable
      • CPU C-States - Enable
      • C1 Enhanced Mode - Enable
      • QPI Link Frequency - Max Performance
    • Power
      • Workload Configuration - Balanced
      • Active Energy Manager - Capping Enabled
  • Для сетевого адаптера включить поддержку SR-IOV.

Vmware. Windows 2008-2012. На виртуалке появляется лишний дуплицирующий IP адрес

​На виртуалке с Windows 2008, 2012 после настройки статического IP адреса может появится лишний дуплицирующий IP адрес вида 169.254.x.x.
Решение из статьи VMwareKB 1028373 False duplicate IP address detected on Microsoft Windows Vista and later virtual machines on ESX/ESXi when using Cisco devices on the environment (1028373)
  • Выключить виртуалку.
  • Перенастроить сетевой адаптер на vSwitch без рабочего аплинка.
  • Включить виртуалку и залогиниться на нее.
  • Зайти в реестр и задать значение параметра ArpRetryCount = 0 в ветке реестра
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
  • Выключить виртуалку.
  • Перенастроить сеть на vSwitch с рабочим аплинком.
  • Включить виртуалку.
Альтернативное решение - отключить gratuitous ARP на коммутаторах Cisco:
# no ip gratuitous-arps

Vmware. Эталонный образ сервера Windows Server


  1. Create virtual machine
    • 4 CPU cores (default)
    • 4 GB RAM (default)
    • 40GB HDD SCSI (0;0) Thin Provision
    • SCSI controller LSI Logic SAS. For VM with high IO load use VMware Paravirtualization (VM PVSCSI)
    • Virtual Machine version 8 (default)
    • use VMXNET3 network adapter
    • Use EFI boot firmware
  2. Install Windows Server 2012
  3. Windows settings
    • install VMware Tools
    • open Control Panel
      • check Date and Time settings
      • check Language Settings (ENG - UKR - RUS)
      • Power Options
        • set High Performance
        • set Turn off the display - Never
      • Region settings
        • check settings
        • Advanced - Copy Settings... - copy settings to welcome screen and New  user account
      • System - Change settings
        • Allow remote connections to this computer
        • set computer name
        • temporary join to Active Directory domain for Windows Update. After updating Windows - remove server form Active Directory
        • Advanced - Startup and Recovery settings - use Small memory dump
    • open cmd with Admin rights and run (it disables hibernation): powercfg -h off
    • select disk C: properties - uncheck Allow files on this drive to have contents indexed in addition to file properties - Apply to C:\ only
    • enable File and Printer Sharing in Windows Firewall for Domain network
    • after installing all Windows Updates
      • cleanup system
        to analyze system run
        dism /Online /Cleanup-Image /AnalyzeComponentStore

        to cleanup system run
        dism /Online /Cleanup-Image /StartComponentCleanup
    • after cleanup system
      • disable swap file and reboot
      • defragment system disk C:
      • enable swap file and reboot
  4. В конце можно финализировать образ
    sysprep /generalize /oobe /shutdown

http://blog.solori.net/2010/09/30/in-the-lab-windows-server-2008-r2-template-for-vmware/
http://www.mikes.eu/index.php/how-to/284-how-to-build-a-windows-2008-r2-vmware-template-2.html
http://willcode4foodblog.wordpress.com/2013/03/22/creating-a-server-2012-golden-image-with-sysprep-and-vmware-workstation-part-2-of-2/

VCSA 51. Интеграция с Active Directory


  1. In the "VMware vCenter Server Appliance" web site got to vCenter Server -> Authentication
    • Check "Active Directory Enabled"
    • Eneter values to fields:
      • Domain - domain name.
      • Administrator user - user principal name (UPN) with administrative rights in the domain.
      • Administrator password - password
    • For example:
  2. Go to vSphere Web Client with root account
    • Go to Administration -> Sign-On and Discovery -> Configuration -> Identity Sources
    • Click the + (green) symbol (Add Identity Source) and fill in the required information:
      • Name - Anything you want to refer to this Identity source as (typically domain name)
      • Primary Server URL: ldap://<domain server FQDN>
      • Secondary Server URL: <optional>
      • Base DN for users: distinguished name (DN) of object unit (OU) with users
      • Domain Name: <Domain Name>
      • Domain alias: <NetBIOS domain name>.
        WARNING!!! You must fill out this field. If you dont - you can't login to vSphere Web Client with AD login <domain>\<username> and option "Use Windows session authentication" don't work.
      • Base DN for groups: distinguished name (DN) of object unit (OU) with groups
      • Authentication Type: (How you want to authenticate the initial connection to your domain)
    • For example:
      • Name - MyDomain
      • Primary Server URL: ldap://mydom-dc1.com
      • Secondary Server URL: ldap://mydom-dc2.com
      • Base DN for users: OU=Users,OU=IT,DC=mydomain,DC=com
      • Domain Name: mydomain.com
      • Domain alias: mydomain
      • Base DN for groups: OU=Groups,OU=IT,DC=mydomain,DC=com
      • Authentication Type: Reuse Session
    • Select your AD server URL and click on the blue dot with an arrow ("Add to default domains").
      WARNING!!! When your domain appears in default domains list click on the blue disk icon to save your change, otherwise you will be wondering why it is not working as expected.
    • Go to Administration -> Access -> SSO Users and Groups -> Groups
      • Select internal group __Administrators__
      • Click "Add Principals"
      • Find user or group in AD domain and add to group __Administrators__
More information can find in this articles:
VMware vCenter 5.1 Installation: Part 9 (Optional SSO Configuration)
Unable to login to vCenter Server after upgrading to vCenter Server 5.1

Vmware. Linux VM. Решение проблемы - разрешение экрана при установке Linux слишком мало

​Решение для Oracle Linux, но, наверно, сработает и для других
  • На экране установки выбираем пункт "Troubleshooting".
  • На следующем экране выбираем пункт "Install Oracle Linux 7.0 in basic graphics mode" и жмем клавишу Tab.
  • Далее возможны три варианта:
    • изменяем параметр xdriver=vesa на xdriver=vmware и жмем Enter.
      Если не срабатывает пробуем следующий вариант.
    • изменяем параметр xdriver=vesa на xdriver=vmware, добавляем параметр inst.resolution=1280x800 и жмем Enter.
      Если не срабатывает пробуем следующий вариант.
    • оставляем параметр xdriver=vesa без изменений, добавляем параметр inst.resolution=1280x800 и жмем Enter.

Vmware. How-to enable SSH for ESXi


  1. Go to the ESXi console and press alt+F1
  2. Type: unsupported
  3. Enter the root password
  4. At the prompt type “vi /etc/inetd.conf
  5. Look for the line that starts with “#ssh” (you can search with pressing “/”)
  6. Remove the “#” (press the “x” if the cursor is on the character)
  7. Save “/etc/inetd.conf” by typing “:wq!”
  8. Reboot server or restart inetd service with command kill -HUP `cat /var/run/inetd.pid`;
Source: link1, link2

Monday, September 12, 2011

Замена SSL сертификата на VMware ESXi 5.0

Процедура описана в документации Data Security Best Practices - SSL keys for communicating with VirtualCenter and other applications. Но мне было проще и быстрее сделать это с помощью SSH и SCP.
  1. Включаем SSH Server на ESXi.
    • В vSphere Client'е заходим в закладку Configuration хоста ESXi, дальше в Security Profile
    • Напротив заголовка Services кликаем Properties...
    • Там кликаем на SSH -> Options... -> Start
    • Готово. SSH включен.
  2. Готовим файлы rui.cer и rui.key. про это можно почитать в статье VCenter SSL - using existing wildcard certificate
  3. Заходим программой WinSCP на ESXi хост в папку /etc/vmware/ssl
  4. Делаем бакап текущих файлов rui.cer и rui.key.
  5. Копируем сюда свои файлы rui.cer и rui.key.
  6. Теперь нужно рестартовать Management Agents. Эта процедура подробно описана в статье Restarting the Management agents on an ESX or ESXi Server
  7. Все.

Замена SSL сертификата на VMware vCenter Server Appliance (VCSA)

- VCSA web interface http://<vcsa_server>:5480
  • prepare your_cert.cer and your_key.key file and copy these files to VCSA server in temporary folder
  • create server.pem file:
      cat your_key.key > server.pem
      cat your_cert.crt >> server.pem
  • server.pem file should be like this:
      -----BEGIN RSA PRIVATE KEY-----
       <private_key>
      -----END RSA PRIVATE KEY-----
      -----BEGIN CERTIFICATE-----
       <certificate>
      -----END CERTIFICATE-----
  • copy and replace our new server.pem file to folder /opt/vmware/etc/lighttpd/server.pem
  • restart lighttpd web server:
      /etc/init.d/vami-lighttp stop
      /etc/init.d/vami-lighttp start
- Vmware vCenter service
  • prepaire rui.crt and rui.key file
  • create rui.pfx. Better way create pfx on VCSA server with this command:
    openssl pkcs12 -export -in rui.crt -inkey rui.key -name rui -passout pass:testpassword -out rui.pfx
  • connect to VCSA via SSH and create backup of these files:
    /etc/vmware-vpx/ssl/rui.*
    /usr/lib/vmware-vpx/inventoryservice/ssl/rui.*
  • copy and replace yours rui.crt, rui.key and rui.pfx to folders:
    /etc/vmware-vpx/ssl/
    /usr/lib/vmware-vpx/inventoryservice/ssl/
  • open file /etc/hosts and add one line in the beginnign of the file:
    <vcsa_ipv4_address> <VCSA_FQDN> <VCSA_host_name>for example:
    192.168.10.15 vcsa.vmware.com vcsa
  • load replacement certificates to memory:
  • restart VCSA server.
  • check that your certificate was installed correctly:
Another useful links about this theme:
vCenter Server Virtual Appliance – Changing SSL Certs Made Easy
Replacing vCenter Server 5 and ESXi Certificates