Thursday, July 27, 2017

Force replication to all Windows Domain Controllers using powershell

Import-Module ActiveDirectory
$DCs = (Get-ADForest).Domains | %Get-ADDomainController -Filter * -Server $_ } | select HostName
foreach ($DC in $DCs)    {        repadmin /syncall $DC.HostName    }
Hope it helps!

Reset UCS KVM

Resetting Cisco UCS KVM


From experience, it’s not uncommon to not be able to connect to the KVM of a cisco ucs blade.   Instead of seeing a Remote console screen, you’ll receive a “Connect failed” or “Request Shared Session” message, with no means of getting to the console.
Within the Service Profile, click on the Server Details tab. From there, click on Recover Server. Select “Reset CIMC (Server Controller)”.  Choose Reset KVM Controller.  This will kill existing KVM sessions and allow you to start a new session. Resetting the CIMC does not affect data traffic to/from the server NICs (ethernet and HBAs).
Another thing to check in Servers tab, General tab is the Management IP Address setting.  If it’s configured to take an address from a pool, check the pool in the Admin tab, Management IP Pool, IP Addresses tab to see what IP’s exist in the range, and whats been assigned.
If a reset hasn’t worked, In the Servers tab, General tab, Management IP Address section, change the IP address from Pooled to Static.  Use an IP address from the other end of the range in the pool.  Click Save Changes, and try connecting to the KVM again

Wednesday, July 26, 2017

Learn Python and PowerShell

Learned via web development 

**Code school** to learn coding 

Classes

https://www.udemy.com/

free, automated, and openCertificate Authority

Secure tunnels to localhost

Secure tunnels to localhost


Demo without deploying
Don’t constantly redeploy your in-progress work to get feedback from clients. ngrok creates a secure public URL (https://yourapp.ngrok.io) to a local webserver on your machine. Iterate quickly with immediate feedback without interrupting flow.

Simplify mobile device testing

Test mobile apps against a development backend running on your machine. Point ngrok at your local dev server and then configure your app to use the ngrok URL. It won't change, even when you change networks. 

Thursday, July 20, 2017

Windows BSOD troubleshooting

Pull the memory.dmp file from c:\windows
Then loaded it in windbg

Set my symbols path as this below and create a c:\symbols directory
SRV*c:\symbols*http://msdl.microsoft.com/download/symbols

You can get even more details if you pull the symbols for VMware or whatever manufacturer’s files show up in the debug file. In the past I’ve had to pull Citrix symbols too.
It’s the only REAL way to dig into BSOD issues.


*Must install*

Windows SDK to use debug tool
https://docs.microsoft.com/en-us/powershell/scripting/setup/installing-the-windows-powershell-sdk?view=powershell-6


Monday, July 17, 2017

vmware converter – p2v – partition number must be set for the boot volume

vmware converter – p2v – partition number must be set for the boot volume

I was trying to archive old machine running RHEL 6.4 on physical server. First idea was to P2V it and then export virtual machine… BUT of course there was some obstacles. At first I’ve tried to use REAR (Relax and Recover) tool to make P2V, then when restoring I discovered, /boot volume comes from multipath and it didn’t really play well… Then I’ve tried Veeam Agent for Linux, however it couldn’t handle that server either, it wasn’t correctly recognizing disk layout. So last bastion, VMWare Converter. Alas it failed as well as it had troubles with /boot volume. I’ve tried to get into rescue mode, recreate /boot volume from scratch but I couldn’t install damn GRUB loader there. Luckily I had original install DVD so I installed OS from scratch and wanted to migrated data from old disk, and then it came to me… I could take /boot volume from fresh install and use VGs from migrated disks! So quickly made minimum 10GB OS install, mounted old VGs, made neccessary changes to etc/fstab and GRUB and it did work with minimal overhead of space (10GB). So here are steps:
1) Clone over disks from old machine onto new VM until it fails with error
2) Get same OS install disk (or atleast similar?)
3) Make fresh, minimal install
4) Mount disk from non-finished machine to new VM
5) Mount migrated VGs in new VM, edit /boot/grub/grub.cfg and /mnt/sysimage/etc/fstab, remember to copy /boot line form current fresh VM /etc/fstab
6) pbase – new VM pzuadm – migrated machine
[root@pbase ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_pbase-lv_root
                      5.5G  1.8G  3.5G  34% /
tmpfs                 939M     0  939M   0% /dev/shm
/dev/sda1             485M   37M  423M   9% /boot
[root@pbase ~]# ls -l /dev/mapper/
total 0
crw-rw----. 1 root root 10, 58 Mar  3 09:42 control
lrwxrwxrwx. 1 root root      7 Mar  3 09:42 vg_pbase-lv_root -> ../dm-0
lrwxrwxrwx. 1 root root      7 Mar  3 09:42 vg_pbase-lv_swap -> ../dm-1
# after attaching disk
[root@pbase ~]# ls -l /dev/mapper/
total 0
crw-rw----. 1 root root 10, 58 Mar  3 09:46 control
lrwxrwxrwx. 1 root root      7 Mar  3 09:46 vg_pbase-lv_root -> ../dm-0
lrwxrwxrwx. 1 root root      7 Mar  3 09:46 vg_pbase-lv_swap -> ../dm-1
lrwxrwxrwx. 1 root root      7 Mar  3 09:46 vg_pzuadm-lv_home -> ../dm-3
lrwxrwxrwx. 1 root root      7 Mar  3 09:46 vg_pzuadm-lv_root -> ../dm-2
lrwxrwxrwx. 1 root root      7 Mar  3 09:46 vg_pzuadm-lv_swap -> ../dm-4
[root@pbase ~]# mkdir /mnt/sysimage
[root@pbase ~]# mount /dev/mapper/vg_pzuadm-lv_root /mnt/sysimage/
[root@pbase ~]# cat /etc/fstab | grep boot
UUID=64d2336b-93cf-454a-8f25-8fc5fc8ba69a /boot                   ext4    defaults        1 2
# before edit
[root@pbase ~]# cat /boot/grub/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/mapper/vg_pbase-lv_root
#          initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux (2.6.32-358.el6.x86_64)
        root (hd0,0)
        kernel /vmlinuz-2.6.32-358.el6.x86_64 ro root=/dev/mapper/vg_pbase-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=vg_pbase/lv_swap SYSFONT=latarcyrheb-sun16 crashkernel=auto  KEYBOARDTYPE=pc KEYTABLE=pl2 rd_LVM_LV=vg_pbase/lv_root rd_NO_DM rhgb quiet
        initrd /initramfs-2.6.32-358.el6.x86_64.img
# after edit
[root@pbase ~]# cat /boot/grub/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/mapper/vg_pzuadm-lv_root
#          initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux (2.6.32-358.el6.x86_64)
        root (hd0,0)
        kernel /vmlinuz-2.6.32-358.el6.x86_64 ro root=/dev/mapper/vg_pzuadm-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=vg_pzuadm/lv_swap SYSFONT=latarcyrheb-sun16 crashkernel=auto  KEYBOARDTYPE=pc KEYTABLE=pl2 rd_LVM_LV=vg_pzuadm/lv_root rd_NO_DM rhgb quiet
        initrd /initramfs-2.6.32-358.el6.x86_64.img
# before edit
[root@pbase ~]# cd /mnt/sysimage/etc/
[root@pbase etc]# cat fstab

#
# /etc/fstab
# Created by anaconda on Tue Feb 11 16:38:25 2014
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg_pzuadm-lv_root /                       ext4    defaults        1 1
/dev/sdb1 /boot                   ext4    defaults        1 2
/dev/mapper/vg_pzuadm-lv_home /home                   ext4    defaults        1 2
/dev/mapper/vg_pzuadm-lv_swap swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
# after edit
[root@pbase etc]# cd
[root@pbase ~]# umount /mnt/sysimage/
[root@pbase ~]# reboot
[root@pzuadm ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_pzuadm-lv_root
                       50G   24G   24G  50% /
tmpfs                 939M     0  939M   0% /dev/shm
/dev/sda1             485M   37M  423M   9% /boot
/dev/mapper/vg_pzuadm-lv_home                       44G  181M   41G   1% /home

Vmware NSX SSL creation 

Using OpenSSL for NSX Manager SSL import: Creates CSR and 4096 bit KEY Creating NSX 6.4.2 SSL    openssl req -out nsxcert.csr -newkey rsa:40...