Syed Jahanzaib Personal Blog to Share Knowledge !

August 18, 2014

Vmware ESXI: You cannot use the vSphere client to edit the settings of virtual machines of version 10 or higher

Filed under: VMware Related — Tags: , — Syed Jahanzaib / Pinochio~:) @ 10:38 AM

Few days back, At remote location, when I converted a physical Linux machine into virtual machine (based on ESXI 5.5 , machine ver 10) I received following error when tried to edit its properties to add new interface card.

Editing virtual machine settings fails with the error: You cannot use the vSphere client to edit the settings of virtual machines of version 10 or higher ...

 

esxi-error.

I had the option to downgrade it using v-converter client, but Time was really short as whole network was down and old physical machine was also out of order, so I used following hack to add the interface quickly and make it online.

.

  • Turn OFF the required Guest,
  • Remove the guest from the inventory (Right-click -> remove from inventory)
  • Browse your ESXI datastore where guest files are placed,
  • Now Download the .vmx file from your the location where your guest files are placed (Example guest’s name.vmx file)
  • Open it in any text editor (Example NOTEPAD PLUS+),
  • Change the following … 

virtualHW.version = “10”

to

 

virtualHW.version = “8”

As showed in the image below …

123.

  • Save this file and upload back to original location.
  • Add the guest back to your inventory by right clicking the vmx file and selecting “Add to inventory”

Now try to edit the guest properties, and this time you will be able to do it.

There were some other workarounds too but in that particular situation, I found this method the most quickest and above all it worked well 🙂

.

Regard’s
Syed Jahanzaib

December 6, 2013

ESXI 5.5 static mac address “conflicts with VMware reserved MACs”

Filed under: VMware Related — Tags: , , — Syed Jahanzaib / Pinochio~:) @ 11:36 AM

esxi-error-5-mc-chang

 

You may see above error in ESXI 5.5 after changing dynamically generated MAC address to STATIC mac address dueto application MAC bind restriction.

In new ESXI 5.5 ,  new policies have been added where the statically assigned MAC addresses can only be in the range 00:50:56:xx:xx:xx series, If you try to change it to something else and then power on the guest machine, you may see above error.

Few days before, a friend of mine upgraded his ESXI from ver 5.0 to 5.5. One of his guest application was binded with the MAC address and the new esxi 5.5 doesn’t allow to use that specific series mac address. So I googled and found following solution that worked (at least for me 😉 )

To RESOLVE this issue, follow this.

1- Enable SSH in ESXI Server Configuration

2- Turn off the target guest machine and change the mac address as per your requirements for the required interface.

3- Turn off the V-Sphere ESXI client.

3- Login to ESXI server via SSH using any ssh client like PUTTY

4- Goto your data store / guest machine folder and open the VMX file.

.

For example I have guest machine with ‘123‘ name. So I used following

~ # cd /vmfs/volumes/
/vmfs/volumes # ls

52a18cdd-49376389-86aa-000c29d1de32  61031d71-0233e8da-be74-f942274c16c3
52a18ce5-9d0863e6-e50b-000c29d1de32  8901537a-ad66db83-fd1f-38ac926cce01
52a18ce7-bd9d6e2a-dacf-000c29d1de32  datastore1
/vmfs/volumes #

/vmfs/volumes # cd datastore1/
/vmfs/volumes/52a18ce5-9d0863e6-e50b-000c29d1de32 # ls
123

/vmfs/volumes/52a18ce5-9d0863e6-e50b-000c29d1de32 # cd 123
/vmfs/volumes/52a18ce5-9d0863e6-e50b-000c29d1de32/123 # ls

123-flat.vmdk               vmware-14.log
123.nvram                     123.vmxf                      vmware-15.log
123.vmdk                      vmware-11.log                 vmware-16.log
123.vmsd                      vmware-12.log                 vmware.log
123.vmx                       vmware-13.log

As showed in the image below . . .

3-putty-ssh

Now open the VMX file of the guest machine.

for example

vi 123.vmx

now press I and add this line anywhere.


ethernet0.checkMACAddress = "false"

(Change the ethernet0 to match your local ethernet number)

Now save and exit it by pressing :wq

Now start V-Sphere ESXI client and start the machine as you normally do 🙂

Congrats you are UP with new MAC address activated 😀

SAMPLE .VMX FILE FOR STATIC MAC address

Following is an sample of working .vmx file for static mac address.

ethernet0.networkName = "LAN"
ethernet0.addressType = "static"
ethernet0.present = "TRUE"
ethernet0.checkMACAddress = "false"
ethernet0.address = "00:0C:29:Ha:Ha:Ho"

Regard’s
Syed Jahanzaib

September 23, 2013

Howto power on Vmware Workstation guest machine

Filed under: VMware Related — Tags: , , — Syed Jahanzaib / Pinochio~:) @ 1:20 PM

matrix_code

Some one asked me howto power on Vmware Workstation guest machine via CLI.  you can use vmrun tool to power on the machine by using target vm guest .vmx file. I decided to write the simple method for my reference too, because I also use it heavily in my virtual lab.

To achieve it, You can create a shortcut on your desktop so that you can quickly start your required workstation base virtual machine by clicking a single icon on your desktop. OR if you want to power it automatically after windows starts, you can create a simple shortcut or batch file and add it windows STARTUP.

SCENARIO:

You have install vmware workstation in H:\vmware_workstation and your guest vm is in H:\temp_images_ubuntu-proxy , then simply use the following shortcut.


D:\vmware_workstation\vmrun start  D:\vmware_images\ubuntu-proxy\ubuntu.vmx

Tip: vmrun is available in workstation folder.

Also read following for more references.

https://aacable.wordpress.com/2012/07/04/howto-power-on-esxi-guess-machine-using-cli-howto-link-it-to-the-dude/

.

.

Regard’s
Syed Jahanzaib

August 26, 2013

Mystry of ethernet not appearing in Ubuntu under VM after mac change

Filed under: Linux Related, VMware Related — Tags: — Syed Jahanzaib / Pinochio~:) @ 8:41 AM

Ubuntu

Recently I was doing an remote installation of Ubuntu Server as a guest VM in ESXI 5.1 in INDIA/PUNE. It was OS requirement to change the default dynamic mac created by VM to some other fixed mac address because of an application requirement which was bind with the specific mac address. After changing mac address to required mac address e.g: 00:0h:c1:96:1c:98 via esxi client in guest vm networking properties , when I rebooted Ubuntu, the Ethernet adapter didn’t not appeared in the networking interfaces list.If i manualy try to bring up the interface by ifconfig eth0 up or ifconfig eth1 up , I receive following error.

SIOCSIFADDR: no such device
eth0: ERROR while getting interface flags: No such device
Bind socket to interface: no such device
Failed to bring up eth0

When I revert it to default (dynamic) it works ok.

After investigating deeply, it revealed that it occurred because if we clone a virtual machine , it creates a new MAC address for each network adapter. The guest operating system detects this is a new network adapter that has been inserted, but retains configuration for the previous network adapter (name and mac).

So here is how I fixed it.

Login to your Ubuntu server (which is installed under vm) with root access ,

Open the file /etc/udev/rules.d/70-persistent-net.rules in nano.

nano /etc/udev/rules.d/70-persistent-net.rules


You will see something like below . . . (After cloning of mac)

# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x1022:0x2000 (pcnet32)  # Entry Ethernet adapter before cloning
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:11:3b:6a:8c", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x1022:0x2000 (pcnet32)  # Entry Ethernet adapter after cloning
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0h:c1:96:1c:98", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

.

Now simply remove the first entry which is old interface entry with mac 00:0c:11:3b:6a:8c,

and in second entry which is eth1, change it to eth0

so after editing the file will look like following.

# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# Syed Jahanzaib . aacable@hotmai.com . https://aacable.wordpress.com

# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0h:c1:96:1c:98", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

Save the file and and exit.

Now simply reboot the Ubuntu server, and then check your interface by

ifconfig

Hopefully it will appear in the list.

.

TIP: To avoid such issues, always change the mac address before OS installation :)~  / Zaib

.

Regard’s
Syed Jahanzaib

April 29, 2013

January 10, 2013

iSCSI SAN/NAS SOLUTION FOR ESXi SERVER (Tutorial No 5)

Filed under: VMware Related — Syed Jahanzaib / Pinochio~:) @ 3:23 PM

iSCSI SAN/NAS SOLUTION FOR ESXi SERVER (Tutorial No 5).

December 12, 2012

Howto add FTP server in ESXi 5.x to support Fast Download/Upload of VM / Images

Filed under: VMware Related — Tags: , , , — Syed Jahanzaib / Pinochio~:) @ 3:59 PM

Yesterday I was trying to upload a 450GB VMDK file to ESXi host. (Actually it was VHD file and I converted it to VMDK using starwind converter), and it was uploading dead slow and showed countless hours to complete the upload.  After some googling I found that generally it takes too much time to Upload/Download any VM/ISO File FROM/TO ESXi host. I also tried VEEAM FASTSCP free tool but no avail. It still works very slow.

However if you add FTP service to your ESXi server, and use ftp client to upload/download files, then the upload/download will be much faster.  ProFTPD runs good in ESXi 5.x and offers high transfer rate over normal transfers.
As showed in the image below . . .

Upload to ESXi Host using Vsphere Client

9.8Mb

Upload to ESXi Host using FTP Client [After adding FTP service in ESXi]

27mb

.
.

To add FTP Service, use the following method.

First We have to Enable SSH in ESXi . Connect to your ESXi host,
Goto Configuration
Goto Security Profiles,
Click on Properties

enable-ssh

2- enable-ssh

.

3- enable-ssh

SSH service is now enabled on ESXi.

Now Connect to your ESXi host using any ssh client like putty.
Navigate to your datastore folder. For example the datastore on my ESXi host name is 1TB,

 cd /vmfs/volumes/1TB/
[Change the 1TB to match your datastore name]

Create any folder where your FTP Service files can be downloaded from the internet or any other source.
[make sure internet service is enabled so file can dierctly download to esxi host, if its not possible then download the package on your client PC, then upload it using Vsphere client and skip to esxcli software install section below . . . ]

mkdir ftp
cd ftp

Now download proftpd by using wget

wget http://esxi-customizer.googlecode.com/files/ProFTPD-1.3.3-8-offline_bundle.zip

Now install it by using esxcli

esxcli software vib install --no-sig-check -d /vmfs/volumes/1TB/ftp/ProFTPD-1.3.3-8-offline_bundle.zip


[Change the 1TB to match your datastore name]

Later if you decide to remove proftp , simply issue following command

To uninstall the package run the following command

esxcli software vib remove -n ProFTPD

Now test it by using simple dos ftp command

ftp 10.0.0.1

ftp

Or using any ftp client like   CUTEFTP PRO

4-ftp-cute

Regard’s
Syed Jahanzaib

December 10, 2012

Vritualization: 3 in 1 > Using Mikrotik + Squid Proxy + Radius on single machine to save resources :)

Filed under: General IT Related, Mikrotik Related, VMware Related — Tags: , , — Syed Jahanzaib / Pinochio~:) @ 1:12 PM

"Virtualizing

.

Its a good idea to virtualize various servers so underutilized hardware can be used more efficiently, as now a days, getting good hardware is not a big deal. It can save considerable amount of power consumption , reduced heat factor , easy to mange multiple VM using various tools like Vcenter / VEEAM (my favorite), VM Explorer , live migrations from one Virtual Server to Another, Backup & Restore becomes very easy and the list goes on . . .

Recently I did an installation of a network where they were low in hardware resources but still they wanted to utilize the benefits of Mikrotik Router OS with external Squid proxy server and also the Radius Billing Server . So in total they required at least 3 physical machines, but I managed to install all of them on single server using Virtualization technology of VMWARE ESXi 5.x (64bit) and it worked so great 🙂
Here is how I did it.

Note: Because of some time shortage, I am just giving you an idea how it can be done, I am not writing in pin point details on how to connect every machine with Virtual/Physical switches. I will write about it soon.

Hardware Used for the Example:

IBM Xseries 3650 XEON Dual Processors with Quad Cores p/p

3.5″ 15krpm SCSI in RAID 10 mode (300GB x 6) (the more Faster drives (like 10-15krpm) you have, the better result you will be able to achieve. Preferably in RAID mode, either 10 or 0, depend on your management and goals, in this example I used 15krpm SCSI HDD’s with dedicated RAID controller. I tested it on IBM xseries with RAID0 and found RAID 0 much more faster with 15krpm but its not redundant, one drive fail and your whole RAID will go down, so if you want redundancy, go with at least RAID 5 or RAID 10 (Recommended) , Raid 1 is also good as it mirrors each drive, but requires additional drives and also for proxy, its useless to use mirroring as it would be requiring more read/write burden on controller, oh GOD, in which argument I got into :p)

16GB RAM (Mikrotik doesn’t requires much RAM in fact it officially supports maximum of 2G, but Radius and Squid do requires some good amount of RAM, I dedicated 8 GB to SQUID, 4GB to Radius, 1 GB to Mikrotik)

4 Network Adapters ( In this article, due-to time shortage, I have only mentioned howto add two network adapters for LAN and WAN link using virtual Switch tech, but you can add more as per your requirements)


Software Used:

1) Vmware ESXi 5.x  64bit as a Virtual Hyper-visor Server

Guest OS installed in this virtual server’s are as following

2) Mikrotik Router-OS 5.22 [1GB Ram +100GB virtual HDD assigned to this VM]
3) Ubuntu 10.4 for SQUID Proxy (2.7) [8GB Ram +500GB virtual HDD assigned to this VM]
4) Ubuntu 10.4 for Radius Manager Billing System [4GB Ram +200GB virtual HDDassigned to this VM]

TIP: You can use the following RAID calculator to evaluate how much space you will be getting various RAID modes.

First install Vmware ESXi. You can get its free edition from http://www.vmware.com  , just register and download the latest version , it would be in .iso format, Simply burn it to CD, and install it on your server , its very simple to install the ESXi, nothing more then just clicking NEXT NEXT 🙂

After ESXi installed, configure IP address on it, so you can manage it using its client called Vsphere client.

To shorten the story I am using only two interfaces for the mikrotik, LAN and WAN. in this example (shorten version) ESXi have two interfaces connected , one with the LAN user switch and other interface connected with the WAN (physically)

Creating Virtual Switch and bind Network Adapters with this switch.

Goto Configuration tab
From the list appear in Hardware section, click on Networking and click on ADD Networking
As showed in the image below , , ,

add-virtual-switch

2- add network wizard

3- add network wizard

4- add network wizard

5- add network wizard

Ok, our virtual switch is created.
Now its time to bind our WAN adapter in this switch. (So it can later be used for WAN for all hosts we will requiring for)

Click on the Properties
6- add network wizard

7- add network wizard

Done.

Creating Mikrotik in VM and assigning network adapters.

Now create new Virtual Machine for your Mikrotik.

Select necessary hardware that you required as required per user load. for example
Mikrotik = 1 CPU / 1 GB RAM / 10 GB HDD /

In Network Adapter Section, by default only one adapter is added, You have to add another adapter by selecting the number of adapters in drop down listing.
As showed in the image below . . .

8- adding lan wan in host

Once the configuration is completed. Simply install the Mikrotik in newly created hosts you just created in above steps.
After configuration is complete, review once again the host settings,
As showed in the image below . . .

9- Mikrotik Network Adapters
After the installation is done, Connect to mikrotik with WINBOX  and look for interfaces
As showed in the image below . . .

mikrotik-interface

.

I will write more on it later.

Regard’s
Syed Jahanzaib

December 7, 2012

HyperV to VMware conversion

Filed under: VMware Related — Tags: , , — Syed Jahanzaib / Pinochio~:) @ 4:53 PM

Howto convert Hyper-V hosts to Vmware ESXi

Task: We want to convert one of our host server running on Hyper-V (installed on Windows 2008 R2 CORE edition), you can use Vmware Vcenter Converter utility to perform this action.

First Download Vmware Vcenter convertetr 5.x from following location.
You must have vmware account to download the utlity, you can rgister it free.

http://downloads.vmware.com/d/details/converter5/dHclYnRqZEBiZEAldw==

After installation Done. Execute it. You may see following screen.
As showed in the image below . . .

1- vmconverter

.

Now click on CONVERT MACHINE
In Source Type , Select HYPER-V
In Server, type your Hyper-V IP
In User Name/Password , type your Administrator ID and password
and click NEXT to continue . . .
As showed in the image below . . .

2- convert-hyperv-machione

If you receive the following error
Unable to contact the specified host ‘x.x.x.x’ . The host might not be available on the network, there might be a network configuration problem, or the management services on this host are not responding
then disable the firewall on HYPERV Windows 2008 by using following command (at hyper v server command prompt)

netsh firewall set opmode disable

Now it will ask you for the agent deployment,
click YES to continue.
As showed in the image below . . .

3- agent

.

.

In next screen of  SOURCE SERVER , It will give you the list of machines hosted on source Hyper-V server.
Select your desired machine ,
and click NEXT to continue
As showed in the image below . . .

4- select source-vm-hyperv

.

.

In Next Screen of  DESTINATION SYSTEM , select the destination VMWARE ESXi Server
As showed in the image below . . .

5- select destination server.

.

In the next screen of  DESTINATION VIRTUAL MACHINE , Click NEXT to continue (Or you can change the machine name label here)
As showed in the image below . . .

6- select name.

.

In the next screen of  DESTINATION LOCATION , Select the datastore location (the drive where you want upload the vm)
As showed in the image below . . .

7- select datastore.
.

In the next screen , it will show you all the options before finally start converting, review all the options and modify if any required. then Click NEXT , and then FINISH to start converting the machine
As showed in the image below . . .

8- final

.

.

Finally it will start conversion of the hyper v machine into Vmware Esxi.
As showed in the image below . . .

9- status.

.

Regard’s
Syed Jahanzaib

December 4, 2012

Howto change MAC address of VM hosted in VM-Workstation

Filed under: VMware Related — Syed Jahanzaib / Pinochio~:) @ 9:02 AM

vmware

ethernet_mac_address

Manually Assigning a MAC Address For VM

To make sure that the same MAC address is assigned to a given virtual machine every time, even if the virtual machine is moved, you can assign the address manually instead of allowing VMware Workstation to assign it automatically. To assign the same, unique MAC address to any virtual machine manually, use a text editor to remove three lines from the configuration file and add two lines. The configuration file has a .vmx extension at the end of the file name.

To change MAC address of any virtual machine running under VM Workstation, Follow the below . . .

1- Make sure that the target VM is turned off.
2- Browse to folder where your VM is available. For example
F:\VM-WARE-IMAGES\UBUNTU

3- Now open VMX file in NOTEPAD , the name would be something like machine_name.VMX

4- Remove the three lines from the configuration file that begin with:


    ethernet0.generatedAddress
    ethernet0.addressType
    ethernet0.generatedAddressOffset


[Note: Change the ethernet0 to match your’s]

Now Add a new static MAC address line to the configuration file with help of the following entries:


ethernet0.addressType = "static"
 ethernet0.address = "00:11:22:33:44:55"

5- Now Save the configuration file. & Start the VM

Regard’s
Syed Jahanzaib

Older Posts »

Blog at WordPress.com.

%d bloggers like this: