Pages

Sunday, December 11, 2016

Friday, December 9, 2016

UNMAP from guest OS

Podpora UNMAP funkcionality ve vSphere 6.0 urcite je: viz clanek od Cormaca Hogana: http://cormachogan.com/2015/05/07/vsphere-6-0-storage-features-part-8-vaai-unmap-changes/

Pozadavky:
  • VMDK must be thin provisioned
  • Virtual Machine Hardware version must be 11 (ESXi 6.0)
  • The advanced setting EnableBlockDelete must be set to 1 – toto je v zakladu vypnuto!
  • The Guest OS must be able to identify the disk as thin (Windows 2012 [updated 30-Oct-2015] uses the B2 mode page to achieve this)

-          Relevantni mi prijde pozadavek na korektni alignment filesystemu vuci lunu. Viz kb: https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2048466

Pro viditelnost prodavam i Davida Paska, posledni dobou toto tema hodne diskutujeme. Jinak i ohledne te funkcionality pro vSphere 6.5 je to zavisle na tom, jestli storage unmap korektne umi - http://cormachogan.com/2016/12/05/determining-array-supports-automated-unmap-vsphere-6-5/, mela by pro to byt spravne oznacena na VMware HCL.


Thursday, November 10, 2016

PowerShell - hints

Display table of PowerShell and subcomponents versions

  • $PSVersionTable

PowerShell ExecutionPolicy Execution Policy

  • For Remote Signed, run Set-ExecutionPolicy RemoteSigned
  • For Unrestricted, run Set-ExecutionPolicy Unrestricted


List all object properties
  • get-vmhost -name esx02.home.uw.cz | Format-List -Property * 

Measure-object .... sum, avg, etc. from objects in pipeline

Get-member ... get info about objects in pipeline. All Properties are displayed.

Select-object ... https://msdn.microsoft.com/en-us/powershell/reference/5.1/microsoft.powershell.utility/select-object

Sort-Object ... sort objects in the pipeline

Sunday, October 23, 2016

mutt configuration - ~/.muttrc

set realname="David Pasek"

# IMAP
set imap_user = 'david.pasek@gmail.com'
set imap_pass = 'Alicka4me..'

set folder = imaps://imap.gmail.com/
set spoolfile = +INBOX
set record = "+[Gmail]/Sent Mail"
set postponed = "+[Gmail]/Drafts"

# SMTP
set smtp_authenticators = 'gssapi:login'
set smtp_url = 'smtps://david.pasek@smtp.gmail.com'
#set smtp_url = 'smtp://david.pasek@smtp.gmail.com:587/'
set smtp_pass = 'Alicka4me..'
set record=""

# SORT
set sort = reverse-date-received

# KEYS
# imap-fetch-mail  
#macro compose I 'imap-fetch-mail'


# COLORS
color normal  white black
color attachment brightyellow black
color hdrdefault cyan black
color indicator black cyan
color markers brightred black
color quoted  green black
color signature cyan black
color status  brightgreen blue
color tilde blue black
color tree  red black

color index red black ~D

color index magenta black ~T

Saturday, October 8, 2016

SIOC Normalizovana latence a velikost IO

Nasel jsem to tady


   /* COMPUTE IO size and adjust avgLatency accordingly */
   1326    latStats->blocksRead = overall_stats.blocksRead - priv->prevBlocksRead;
   1327    latStats->blocksWritten = overall_stats.blocksWritten - priv->prevBlocksWritten;
   1328    totalblocks = latStats->blocksRead + latStats->blocksWritten;
   1329 
   1330    priv->prevBlocksRead = overall_stats.blocksRead;
   1331    priv->prevBlocksWritten = overall_stats.blocksWritten;
   1332    avgIOSize = (totalblocks * pd->blkSize) / latStats->ioCount;
   1333    if (avgIOSize > 1024) {
   1334       // compute size in KB, blkSize is in Bytes
   1335       avgIOSize = avgIOSize / 1024;
   1336    } else {
   1337       // Assume 1 KB as minimum
   1338       avgIOSize = 1;
   1339    }
   1340 
   1341    /* adjust latency based on avg IO size */
   1342    latStats->avgLatency /= (1.0 + (avgIOSize / IOSIZE_ADJUST));


IOSIZE_ADJUST je 512

avgIOSize je v KB

Takze latence treba pro I/O o velikosti 128kB by bylo adjustovano na namerenou latency vydelenou 1+(128/512), takze by se latence vydelila 1.25, takze by se latence snizila o 20%.
U I/O o velikosti 1024kB by to se latence delila 1+(1024/512), takze cislem 3 a tam by se latence snizila na 33%.

Takze je to jinak, nez jsem nekde cetl, a mozna proto to ten nekdo (myslim, ze Frank Denneman) dal pryc ;-)

A dalsi vec je, ze to mohlo byt jinak v ESXi 4 a ted je to takto v ESXi 6. Jeste jsem koukal, ze je to takto I v ESXi 5, ale zdrojaky ESXi 4 uz tam nejsou.

SIOC v ESXi 5 bylo oproti ESX 4.1 vyrazne vylepseno. Ve 4.1 bylo SIOC uvedeno poprve.

Kazdopadne tam probiha urcity adjustment v zavislosti na velikosti I/O.

Thursday, July 28, 2016

BIND configuration file (named) - forward zone

named.conf

options {
        // All file and path names are relative to the chroot directory,
        // if any, and should be fully qualified.
        directory       "/usr/local/etc/namedb/working";
        pid-file        "/var/run/named/pid";
        dump-file       "/var/dump/named_dump.db";
        statistics-file "/var/stats/named.stats";
        allow-query     { any; };
        allow-transfer  { any; };

// If named is being used only as a local resolver, this is a safe default.
// For named to be accessible to the network, comment this option, specify
// the proper IP address, or delete this option.
        listen-on       { 127.0.0.1; 192.168.4.4; };
...
        forwarders {
                8.8.8.8; 8.8.4.4;
        };

...

zone "home.uw.cz" {
        type master;
        file "/usr/local/etc/namedb/master/home.uw.cz.db";
};

zone "4.168.192.in-addr.arpa" {
        type master;
        file "/usr/local/etc/namedb/master/4.168.192.in-addr.arpa.db";
};


ZONE CONF

SOA entry


Serial number
Serial number of the database file. It is maintained automatically and cannot be changed.
Administrator
E-mail address of the person responsible for data. Cannot be changed.
TTL
This value refers to all DNS entries of the given domain. It determines how long the other (non-authoritative) name files can keep the given entry in their cache memory. The lower the value the sooner the changes in the entries fully show on the whole Internet. It is recommended to be set to 1 day.
recovery (refresh)
Determinates how often the secondary name servers check its data.
Repetition (retry)
If the secondary name server cannot contact the primary server after the expiration of the Recovery interval, the next attempts follow in an interval determined by the value of Repetition in seconds.
Validity expiration (expire)
If the secondary name server cannot contact the primary servers until the Validity expiration, it will stop providing any information. The validity expiration must have a higher value than Recovery.
DNS entries


Name
Domain name within your domain. If the domain name is given without full stop at the end, the current domain will be automatically added. If the domain name is entered with a full stop at the end, it is held for an absolute name. You can enter as domain name the commercial sign @, which refers to the current domain, or the asterisk *, which refers to all domain names not explicitly defined.
Type
Entry type A, MX, CNAME or NS.
Database
Data depending on the type of entry. If you use full domain name, do not forget to put a full stop behind it, otherwise the name will be completed with the current domain.
MX
Mail server priority. Makes sense only with MX type entries. The e-mails are delivered to the server with the lowest priority first.

Bind DNS Server Web interface,Frontend or GUI Tools
http://www.debianadmin.com/bind-dns-server-web-interfacefrontend-or-gui-tools.html

Examples:

$TTL    3h
vsphere.local. SOA ns1.vshere.local. vsphere.local. 45 1d 12h 1w 3h
        ; Serial, Refresh, Retry, Expire, Neg. cache TTL

        NS      ns1.vsphere.local.

ns1     A       192.168.14.1
dns     CNAME   ns1
gw      CNAME   ns1
vc      A       192.168.14.100
nsxm    A       192.168.14.99

-----------------------------------------------------------------------

$TTL 10800
example.com.    IN      SOA      ns1.example.uw.cz. dpasek.example.com. (
                                2016072806      ; Serial
                                10800           ; Refresh
                                3600            ; Retry
                                604800          ; Expire
                                300             ; Negative Response TTL
                        )

; DNS Servers
                IN      NS      ns1.example.com.
                IN      NS      ns2.example.com.

; MX Records
;                IN      MX 10   mx.example.com.
;                IN      MX 20   mail.example.com.

; Machine Names
ns1             IN      A       192.168.4.4
ns2             IN      A       192.168.4.20
;
server1       IN      A       192.168.4.60
server2       IN      A       192.168.4.61

; Aliases
web1          IN      CNAME   server1.example.com.
web2          IN      CNAME   server2.example.com.
 
-----------------------------------------------------------------------
 
$TTL 86400
@       IN      SOA     ns1.p6.uw.cz. admin.p6.uw.cz. (
                        2024030902  ; Serial
                        3600        ; Refresh
                        1800        ; Retry
                        1209600     ; Expire
                        86400 )     ; Minimum TTL

        IN      NS      ns1.p6.uw.cz.

gw1     IN      A       10.160.4.254
ns1     IN      A       10.160.4.254
mwin01  IN      A       10.160.4.24
mlin01  IN      A       10.160.4.26
nsxm    IN      A       10.160.4.99
vc01    IN      A       10.160.4.100
esx11   IN      A       10.160.4.111
esx12   IN      A       10.160.4.112
esx13   IN      A       10.160.4.113
esx14   IN      A       10.160.4.114

Test DNS

to resolve forward record
dig +noall +answer www.gnu.org

to resolve reverse lookup
dig +noall +answer -x 199.232.41.10


BIND configuration file - reverse zone

$TTL 10800
4.168.192.in-addr.arpa. IN      SOA     ns1.home.uw.cz. dpasek.home.uw.cz. (
                                2016072808      ; Serial
                                10800           ; Refresh
                                3600            ; Retry
                                604800          ; Expire
                                300             ; Negative Response TTL
                        )

4.168.192.in-addr.arpa. IN      NS      ns1.home.uw.cz.
4.168.192.in-addr.arpa. IN      NS      ns2.home.uw.cz.

100                     IN      PTR     vc01.home.uw.cz.
101                     IN      PTR     esx01.home.uw.cz.
102                     IN      PTR     esx02.home.uw.cz.