Friday, November 20, 2015

Workaround for vmrun under VMWare Workstation 12

Ever since upgrading to VMWare Worksation 12 (12.0.0, 12.0.1 and 12.1.0), I haven't been able to use 'vmrun' to work with my Shared virtual machines. This had been working since (at least WS8) and up to (and including) VMWare Workstation 11.1.2.

I used to be able to do this in shared workstation mode:

$  /usr/bin/vmrun -T ws-shared -h https://localhost:943/sdk -u user1 listRegisteredVM
Total registered VMs: 23
[ha-datacenter/standard] WinVista/winVista.vmx
[ha-datacenter/standard] RHEL6_x64/RHEL6.vmx
[ha-datacenter/standard] VCS41_node1/VCS4.vmx
[ha-datacenter/standard] VCS41_node2/VCS4.vmx
[ha-datacenter/standard] VCS41_node3/VCS4.vmx
[ha-datacenter/standard] VCS41_node4/VCS4.vmx
[ha-datacenter/standard] VCS51_node1/VCS5.vmx
[ha-datacenter/standard] VCS51_node2/VCS5.vmx
[ha-datacenter/standard] VCS51_node3/VCS5.vmx
[ha-datacenter/standard] WinXP/winXPPro.vmx
[ha-datacenter/standard] VCS51_node4/VCS5.vmx
[....]

Now, on VMW 12, I just get this failure:

$  /usr/bin/vmrun -T ws-shared -h https://localhost:943/sdk -u user1 listRegisteredVM
Host password: 
Unable to connect to host.
Error: The specified service provider was not found

Fortunately, vmrun (part of the VIX API bundle) is quite flexible and I just found a workaround.

On a normal VMW 12 install, there's a text config file that lists the API endpoints:

$ cat /usr/lib/vmware-vix/vixwrapper-config.txt 
[....]
# Workstation 12.0.0
ws        19  vmdb  12.0.0 Workstation-12.0.0
player    19  vmdb  12.0.0 Workstation-12.0.0

# Workstation 12.0.1
ws        19  vmdb  12.0.1 Workstation-12.0.0
player    19  vmdb  12.0.1 Workstation-12.0.0

# EOF

On VMW 11, you'll note that the 'ws-shared' entries are present whereas they are missing from VMW 12.

$ cat /usr/lib/vmware-vix/vixwrapper-config.txt 
[....]
# Workstation 11.0.0
ws        17  vmdb  11.0.0 Workstation-11.0.0-and-vSphere-6.0.0
player    17  vmdb   7.0.0 Workstation-11.0.0-and-vSphere-6.0.0
ws-shared 17  none  11.0.0 Workstation-11.0.0-and-vSphere-6.0.0

# Workstation 11.1.0
ws        17  vmdb  11.1.0 Workstation-11.0.0-and-vSphere-6.0.0
player    17  vmdb   7.1.0 Workstation-11.0.0-and-vSphere-6.0.0
ws-shared 17  none  11.1.0 Workstation-11.0.0-and-vSphere-6.0.0

# Workstation 11.1.2
ws        17  vmdb  11.1.2 Workstation-11.0.0-and-vSphere-6.0.0
player    17  vmdb   7.1.2 Workstation-11.0.0-and-vSphere-6.0.0
ws-shared 17  none  11.1.2 Workstation-11.0.0-and-vSphere-6.0.0

# ESX/vSphere/Server2.0 support
viserver 12  none 2.0.0   Workstation-11.0.0-and-vSphere-6.0.0
esx      12  none 4.0.0   Workstation-11.0.0-and-vSphere-6.0.0

The workaround is a two-part process:

  • copy the libs from a VMW11 to your VMW12 install.
That's only the /usr/lib/vmware-vix/Workstation-11.0.0-and-vSphere-6.0.0 directory.

  • edit vixwrapper-config.txt on VMW12 to add the missing entries and point to the libs you just copied over.
$ cd /usr/lib/vmware-vix
$ diff -c vixwrapper-config.txt.orig vixwrapper-config.txt
*** vixwrapper-config.txt.orig  Fri Oct 30 11:52:49 2015
--- vixwrapper-config.txt       Fri Nov 20 15:59:39 2015
***************
*** 26,34 ****
--- 26,36 ----
  # Workstation 12.0.0
  ws        19  vmdb  12.0.0 Workstation-12.0.0
  player    19  vmdb  12.0.0 Workstation-12.0.0
+ ws-shared 19  none  12.0.0 Workstation-11.0.0-and-vSphere-6.0.0
  
  # Workstation 12.0.1
  ws        19  vmdb  12.0.1 Workstation-12.0.0
  player    19  vmdb  12.0.1 Workstation-12.0.0
+ ws-shared 19  none  12.0.1 Workstation-11.0.0-and-vSphere-6.0.0
  
  # EOF

That's the end of the story, vmrun works again with VMW 12 in Shared VMWare Workstation mode...:

$ /usr/bin/vmrun -T ws-shared -h https://localhost:943/sdk -u user1 listRegisteredVM
Host password:
Total registered VMs: 42
[ha-datacenter/standard] VCS41_node1/VCS4.vmx
[ha-datacenter/standard] VCS41_node2/VCS4.vmx
[ha-datacenter/standard] VCS41_node3/VCS4.vmx
[ha-datacenter/standard] VCS41_node4/VCS4.vmx
[ha-datacenter/standard] VCS51_node1/VCS5.vmx
[ha-datacenter/standard] VCS51_node2/VCS5.vmx
[ha-datacenter/standard] VCS51_node3/VCS5.vmx
[ha-datacenter/standard] WinXP/winXPPro.vmx
[ha-datacenter/standard] VCS51_node4/VCS5.vmx
[ha-datacenter/standard] DOS622/dos.vmx
[ha-datacenter/standard] Beini_122/Beini.vmx
[....]


For your convenience, I placed a zip file here with the proper files on my site.
Extract with:
$ sudo unzip -o -d / vmrun_ws-shared_VMW12.zip

Tuesday, November 10, 2015

Introducing.. lseth/lsnet

Hi everyone,

I am not sure about you but systems with many interfaces and ips hurt my eyes.
Thus, a few months ago, I started writing a small tool to help display relevant information in a more compact way.
I named this tool 'lseth' and its python rewrite will become 'lsnet'. It can display Linux bonds, the active interface and the current MAC of the bond.

Here's what it does:

On a RHEL7.1 system with OSP7, instead of this:
  1. # ip a s  
  2. 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN  
  3.     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00  
  4.     inet 127.0.0.1/8 scope host lo  
  5.        valid_lft forever preferred_lft forever  
  6.     inet6 ::1/128 scope host  
  7.        valid_lft forever preferred_lft forever  
  8. 2: eth0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP qlen 1000  
  9.     link/ether 00:50:56:3c:f8:dd brd ff:ff:ff:ff:ff:ff  
  10. 3: eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond1 state UP qlen 1000  
  11.     link/ether 00:50:56:3c:72:c4 brd ff:ff:ff:ff:ff:ff  
  12. 4: eth2: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond2 state UP qlen 1000  
  13.     link/ether 00:50:56:2d:f6:f6 brd ff:ff:ff:ff:ff:ff  
  14. 5: ovs-system: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN  
  15.     link/ether ae:4e:20:a3:25:98 brd ff:ff:ff:ff:ff:ff  
  16. 6: br-ex: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN  
  17.     link/ether 00:50:56:3c:f8:dd brd ff:ff:ff:ff:ff:ff  
  18.     inet 10.0.128.165/22 brd 10.0.131.255 scope global br-ex  
  19.        valid_lft forever preferred_lft forever  
  20.     inet6 fe80::250:56ff:fe3c:f8dd/64 scope link  
  21.        valid_lft forever preferred_lft forever  
  22. 7: br-int: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN  
  23.     link/ether 32:4f:6f:b0:37:4a brd ff:ff:ff:ff:ff:ff  
  24. 8: br-tun: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN  
  25.     link/ether fa:c3:7b:3f:40:40 brd ff:ff:ff:ff:ff:ff  
  26. 9: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue master ovs-system state UP  
  27.     link/ether 00:50:56:3c:f8:dd brd ff:ff:ff:ff:ff:ff  
  28.     inet6 fe80::250:56ff:fe3c:f8dd/64 scope link  
  29.        valid_lft forever preferred_lft forever  
  30. 10: bond1: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP  
  31.     link/ether 00:50:56:3c:72:c4 brd ff:ff:ff:ff:ff:ff  
  32.     inet6 fe80::250:56ff:fe3c:72c4/64 scope link  
  33.        valid_lft forever preferred_lft forever  
  34. 11: bond2: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP  
  35.     link/ether 00:50:56:2d:f6:f6 brd ff:ff:ff:ff:ff:ff  
  36.     inet6 fe80::250:56ff:fe2d:f6f6/64 scope link  
  37.        valid_lft forever preferred_lft forever  
  38. 15: qbr1eace6ff-34: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP  
  39.     link/ether ae:65:4b:c3:3c:28 brd ff:ff:ff:ff:ff:ff  
  40.     inet6 fe80::b7:9cff:febc:41e6/64 scope link  
  41.        valid_lft forever preferred_lft forever  
  42. [.....output abreviated....]  

Then you'll get this:
  1. # lseth   
  2.   
  3.   
  4. #PHYS  STATE  SPEED   MTU DRIVER        HW_Path       MAC_Addr                IP_Addr              Description  
  5. eth0      up   1000  1500 e1000         0000:02:02.0  00:50:56:3c:f8:dd       N/A                  Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev  
  6. eth1      up   1000  1500 e1000         0000:02:06.0  00:50:56:3c:72:c4       N/A                  Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev  
  7. eth2      up   1000  1500 e1000         0000:02:07.0  00:50:56:2d:f6:f6       N/A                  Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev  
  8.   
  9.   
  10. #VIRT             STATE   MTU DRIVER                     Active MAC              IP_Addr              Description  
  11. bond0                up  1500 bonding (3.7.1)            00:50:56:3c:f8:dd       N/A                  [ eth0 ]  
  12. bond1                up  1500 bonding (3.7.1)            00:50:56:3c:72:c4       N/A                  [ eth1 ]  
  13. bond2                up  1500 bonding (3.7.1)            00:50:56:2d:f6:f6       N/A                  [ eth2 ]  
  14. br-ex                up  1500 openvswitch (3.10.0-22...) 00:50:56:3c:f8:dd       10.0.128.165/22      N/A  
  15. br-int           (down)  1500 openvswitch (3.10.0-22...) 32:4f:6f:b0:37:4a       N/A                  N/A  
  16. br-tun           (down)  1500 openvswitch (3.10.0-22...) fa:c3:7b:3f:40:40       N/A                  N/A  
  17. ovs-system       (down)  1500 openvswitch (3.10.0-22...) ae:4e:20:a3:25:98       N/A                  N/A  
  18. qbr1eace6ff-34       up  1500 bridge (2.3)               ae:65:4b:c3:3c:28       N/A                  N/A  
  19. qbr6a35e050-ee       up  1500 bridge (2.3)               c6:bc:28:9c:2a:ce       N/A                  N/A  
  20. qbr7bf44648-c3       up  1500 bridge (2.3)               ca:ff:e7:5e:f5:26       N/A                  N/A  
  21. qbr35e0d8b2-83       up  1500 bridge (2.3)               6e:69:de:21:c8:9b       N/A                  N/A  
  22. qbr79f83edf-d8       up  1500 bridge (2.3)               86:f9:f5:90:a7:c7       N/A                  N/A  
  23. qbr397526b7-44       up  1500 bridge (2.3)               d6:7e:49:a6:32:53       N/A                  N/A  
  24. qbrbd38c1c4-14       up  1500 bridge (2.3)               fe:38:81:e8:32:03       N/A                  N/A  
  25. qbrd5eb3687-5a       up  1500 bridge (2.3)               8a:a1:75:a4:07:ab       N/A                  N/A  
  26. qvb1eace6ff-34       up  1500 veth (3.10.0-229.20.1)     ae:65:4b:c3:3c:28       N/A                  N/A  
  27. qvb6a35e050-ee       up  1500 veth (3.10.0-229.20.1)     c6:bc:28:9c:2a:ce       N/A                  N/A  
  28. qvb7bf44648-c3       up  1500 veth (3.10.0-229.20.1)     ca:ff:e7:5e:f5:26       N/A                  N/A  
  29. qvb35e0d8b2-83       up  1500 veth (3.10.0-229.20.1)     6e:69:de:21:c8:9b       N/A                  N/A  
  30. qvb79f83edf-d8       up  1500 veth (3.10.0-229.20.1)     86:f9:f5:90:a7:c7       N/A                  N/A  
  31. qvb397526b7-44       up  1500 veth (3.10.0-229.20.1)     d6:7e:49:a6:32:53       N/A                  N/A  
  32. qvbbd38c1c4-14       up  1500 veth (3.10.0-229.20.1)     fe:38:81:e8:32:03       N/A                  N/A  
  33. qvbd5eb3687-5a       up  1500 veth (3.10.0-229.20.1)     8a:a1:75:a4:07:ab       N/A                  N/A  
  34. qvo1eace6ff-34       up  1500 veth (3.10.0-229.20.1)     52:8a:42:c8:52:36       N/A                  N/A  
  35. qvo6a35e050-ee       up  1500 veth (3.10.0-229.20.1)     5a:0c:70:1b:4b:41       N/A                  N/A  
  36. qvo7bf44648-c3       up  1500 veth (3.10.0-229.20.1)     fa:65:75:82:17:dd       N/A                  N/A  
  37. qvo35e0d8b2-83       up  1500 veth (3.10.0-229.20.1)     52:9c:02:99:64:b4       N/A                  N/A  
  38. qvo79f83edf-d8       up  1500 veth (3.10.0-229.20.1)     52:90:4c:c6:da:0b       N/A                  N/A  
  39. qvo397526b7-44       up  1500 veth (3.10.0-229.20.1)     d6:51:d4:73:1e:e4       N/A                  N/A  
  40. qvobd38c1c4-14       up  1500 veth (3.10.0-229.20.1)     7a:bf:ea:8c:44:8e       N/A                  N/A  
  41. qvod5eb3687-5a       up  1500 veth (3.10.0-229.20.1)     22:30:00:96:b2:e7       N/A                  N/A  

Here are a few other examples:
Simplistic RHEL6.7 system:
  1. # lseth  
  2.   
  3.   
  4. #PHYS  STATE  SPEED   MTU DRIVER        HW_Path       MAC_Addr                IP_Addr              Description  
  5. eth0      up   1000  1500 igb           0000:03:00.0  d0:50:99:5b:da:72       N/A                  Intel Corporation I210 Gigabit Network Connection (rev 03)  
  6. eth1      up   1000  1500 igb           0000:04:00.0  d0:50:99:5b:da:73       N/A                  Intel Corporation I210 Gigabit Network Connection (rev 03)  
  7. eth2      up   1000  1500 ax88179_178a  3-4:1.0       00:24:9b:0b:de:10       N/A                   
  8. eth3      up   1000  1500 ax88179_178a  3-3:1.0       00:24:9b:13:26:7c       N/A                   
  9.   
  10.   
  11. #VIRT     STATE   MTU DRIVER                             Active MAC              IP_Addr              Description  
  12. bond0        up  1500 bonding (3.7.1)                    d0:50:99:5b:da:72       10.0.128.246/22      [ eth0 ]  
  13. bond1        up  1500 bonding (3.7.1)                    d0:50:99:5b:da:73       172.17.1.102/24      [ eth1 ]  
  14. bond2        up  1500 bonding (3.7.1)                    00:24:9b:0b:de:10       N/A                  [ eth2 ]  
  15. bond3        up  1500 bonding (3.7.1)                    00:24:9b:13:26:7c       N/A                  [ eth3 ]  
  16. dummy0   (down)  1500 dummy (2.6.32-573.7.1)             ce:eb:7d:e8:b6:0a       N/A                  N/A  
  17. dummy1   (down)  1500 dummy (2.6.32-573.7.1)             42:20:a0:f6:a1:62       N/A                  N/A  
  18. vmnet2       up  1500 vmnet (2.6.32-573.7.1)             00:50:56:c0:00:02       10.128.16.1/24       N/A  
  19. vmnet4       up  1500 vmnet (2.6.32-573.7.1)             00:50:56:c0:00:04       10.128.17.1/24       N/A  
  20. vmnet6       up  1500 vmnet (2.6.32-573.7.1)             00:50:56:c0:00:06       10.128.18.1/24       N/A  

Simplistic RHEL5 system:
  1. #PHYS  STATE  SPEED   MTU DRIVER        HW_Path       MAC_Addr                IP_Addr              Description  
  2. eth0      up   1000  1500 e1000         0000:02:00.0  00:0c:29:16:91:04       N/A                  Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev  
  3.   
  4. #VIRT    STATE   MTU DRIVER                              Active MAC              IP_Addr              Description  
  5. bond0       up  1500 bonding (3.4.0-2)                   00:0c:29:16:91:04       10.0.128.158/24      [ eth0 ]  

It's still a very rough work in progress but I'd like to share it with all the good people here to get valuable input (would it be useful in your daily job?, RFE's, etc..)
Meanwhile, I already know I'll want to:
1) populate entries that are related to OVS and OVS-Bonds.
2) fix a few bugs (infiniband, etc..)
3) rewrite the whole thing in python to make it faster
4) add an option to explore the network namespaces and display interfaces underneath.


Ideas are most welcomed!

LVM2 bootdisk encapsulation on RHEL7/Centos7

Introduction Hi everyone, Life on overcloud nodes was simple back then and everybody loved that single 'root' partition on th...