lost and found ( for me ? )

Showing posts with label ESXi 4.1 update 1. Show all posts
Showing posts with label ESXi 4.1 update 1. Show all posts

ESXi 4.1.0 Update 1 : How to mount a remote ESXi’s vmfs from Ubuntu

I referred to the following URL.

Ubuntu 11.04
VMware ESXi 4.1.0 build-348481
             
              mount ESXi’s vmfs
Ubuntu ---------------------------- ESXi

[ preparation ]

[ on Ubuntu ]

install sshfs
# apt-get install sshfs


To mount vmfs with sshfs from ubuntu , sftp is needed on a remote machine(ESXi).
copy sftp-server binary file to ESXi’s /sbin/directory.

on Ubuntu , download sftp-server.tar.gz , extract tar.gz , copy sftp-server file to ESXi’s /sbin directory.
# wget http://thebsdbox.co.uk/wp-content/uploads/2010/08/sftp-server.tar.gz

# tar xzvf sftp-server.tar.gz
sftp-server

# file sftp-server
sftp-server: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, for GNU/Linux 2.2.5, not stripped

# scp sftp-server root@vmware:/sbin/


confirm there’s sftp-server file under ESXi’s /sbin directory.

[ on ESXi ]
~ # vmware -lv
VMware ESXi 4.1.0 build-348481
VMware ESXi 4.1.0 Update 1~

# ls /sbin/sftp-server
/sbin/sftp-server


[ mount a remote ESXi’s vmfs from Ubuntu ]

[ on Ubuntu ]
# sshfs -o idmap=user root@vmware:/ /root/tmp_dir
root@vmware's password:

# cd /root/tmp_dir/
# ls
altbootbank  dev  lib64      opt            sbin     tmp  vmfs
bin          etc  local.tgz  proc           scratch  usr  vmimages
bootbank     lib  locker     productLocker  store    var  vmupgrade


unmount
# fusermount -u /root/tmp_dir


[ tips ]

Unfortunately , when rebooting ESXi , /sbin/sftp-server file will be removed.
To solve this , copy sftp-server file to ESXi’s oem.tgz file.

[ on Ubuntu ]
# scp root@vmware:/bootbank/oem.tgz .
root@vmware's password:
oem.tgz                                       100%  928KB 927.8KB/s   00:00

# cd zzz/
# cp /root/oem.tgz .

# pwd
/root/zzz

# ls
oem.tgz

# tar xzvf oem.tgz

# rm oem.tgz

# ls
etc  lib  oem.tgz  sbin  usr  var

# cp /root/sftp-server sbin/

# tar czvf oem.tgz *
etc/
etc/cim/
etc/vmware/
etc/vmware/init/
etc/vmware/init/manifests/
etc/vmware/init/manifests/Neterion-vxge.mf
etc/vmware/init/manifests/LSI-3w-9xxx.mf
etc/vmware/pciid/
etc/vmware/pciid/vxge.xml
etc/vmware/pciid/3w-9xxx.xml
etc/ipmi/
lib/
lib/cim/
sbin/
sbin/sftp-server
usr/
usr/lib/
usr/lib/vmware/
usr/lib/vmware/vmkmod/
usr/lib/vmware/vmkmod/vxge.o
usr/lib/vmware/vmkmod/3w-9xxx.o
usr/lib/ext/
usr/lib/pycim/
var/
var/db/
var/db/esxupdate/
var/db/esxupdate/oem-pkgdb.tgz
var/lib/
var/lib/sfcb/
var/lib/sfcb/registration/


copy oem.tgz to ESXi’s /bootbank directory

[ on Ubuntu ]
# scp oem.tgz root@vmware:/bootbank/
root@vmware's password:
oem.tgz                                       100% 2002KB   2.0MB/s   00:00


[ on ESXi ]
After rebooting ESXi , there’s sftp-server file under /sbin directory.
Tech Support Mode may be disabled by an administrative user.
Please consult the ESXi Configuration Guide for additional
important information.

~ # ls /sbin/sftp-server
/sbin/sftp-server

ESXi 4.1.0 Update 1: How to make a clone VM via CLI


~ # vmware -v
VMware ESXi 4.1.0 build-348481

create a directory for a clone VM
~ # mkdir /vmfs/volumes/datastore1/CLONE

make a clone VM with vmkfstools command.

vmkfstools –i “/parh/original VM.vmdk” “/path/clone VM.vmdk”
~#vmkfstools -i /vmfs/volumes/datastore1/ORIGINAL/ORIGINAL.vmdk /vmfs/volumes/datastore1/CLONE/CLONE.vmdk
Destination disk format: VMFS zeroedthick
Cloning disk '/vmfs/volumes/datastore1/ORIGINAL/ORIGINAL.vmdk'...
Clone: 100% done.
~ #

copy original VM’s vmx file to clone VM’s directory.
# cp ../ORIGINAL/ORIGINAL.vmx CLONE.vmx

modify vmx file
# cat CLONE.vmx | grep -v "ethernet0.generatedAddress = " | grep -v "ethernet0.generatedAddressOffset = " | grep -v "uuid.location = " | grep -v "uuid.bios = " | sed 's/'"ORIGINAL"'/'"CLONE"'/g' > vmx.tmp | echo 'uuid.action = "keep"' >> vmx.tmp

# cp vmx.tmp CLONE.vmx

register a clone VM
please note that you need to specify full path.
# /bin/vim-cmd solo/registervm /vmfs/volumes/datastore1/CLONE/CLONE.vmx

ESXi 4.1 update 1: How to change language environment of vSphere Client

vSphere Client Version : 4.1.0 Build 345043
VMware ESXi Version : 4.1.0 Build 348481

I installed vSphere client with Japanese language environment , but I want to change it in English.

There are two ways

- method 1

open command prompt and start vSphere client ( VpxClient.exe ) with “--locale en_US” option.

>"C:\ProgramFiles\VMware\Infrastructure\VirtualInfrastructureClient\Launcher\VpxClient.exe" --locale en_US


- method 2

open VMware vSphere Client property and add “--local en_US”.



Language environment has changed in English.

VMware ESXi 4.1.0 Update 1 : CPU Hot plug


I referred to the following URL.
http://communities.vmware.com/docs/DOC-10493

[ software info ]

ESXi
~ # vmware -l
VMware ESXi 4.1.0 Update 1


VM is Scientific Linux6 (SL6) 32bit. I assigned 1 vCPU.
[root@sl6-1 ~]# cat /etc/redhat-release
Scientific Linux release 6.0 (Carbon)

[root@sl6-1 ~]# uname -r
2.6.32-131.6.1.el6.i686


[ procedures ]

Step1

power off VM

Step2

on vSphere client , enable CPU hot plug to that VM.

Step3

power on VM

Step4

add vCPUs

on vSphere client , VM -> edit -> Hardware -> CPU
I changed # of vCPUs from 1 to 4.


dmesg
[root@sl6-1 ~]# dmesg
processor LNXCPU:03: registered as cooling_device3
SMP alternatives: switching to SMP code
Booting Node 0 Processor 3 APIC 0x3
Initializing CPU#3
mce: CPU supports 0 MCE banks
x86 PAT enabled: cpu 3, old 0x0, new 0x7010600070106
Skipped synchronization checks as TSC is reliable.
Booting Node 0 Processor 2 APIC 0x2
Initializing CPU#2
mce: CPU supports 0 MCE banks
x86 PAT enabled: cpu 2, old 0x0, new 0x7010600070106
Skipped synchronization checks as TSC is reliable.
Booting Node 0 Processor 1 APIC 0x1
Initializing CPU#1
mce: CPU supports 0 MCE banks
x86 PAT enabled: cpu 1, old 0x0, new 0x7010600070106
Skipped synchronization checks as TSC is reliable.


# of vCPU truns 4.
[root@sl6-1 ~]# cat /proc/cpuinfo | grep "model name" | wc -l
4


On SL6 32bit , I don’t need to do anything to activate hot-plugged vCPUs.
Just only change # of vCPUs via vSphere client.

change # of vCPUs from 4 to 8.

# of vCPU turns 8.
[root@sl6-1 ~]# cat /proc/cpuinfo | grep "model name" | wc -l
8


dmesg
processor LNXCPU:07: registered as cooling_device7
Booting Node 0 Processor 6 APIC 0x6
Initializing CPU#6
mce: CPU supports 0 MCE banks
x86 PAT enabled: cpu 6, old 0x0, new 0x7010600070106
Skipped synchronization checks as TSC is reliable.
Booting Node 0 Processor 5 APIC 0x5
Initializing CPU#5
mce: CPU supports 0 MCE banks
x86 PAT enabled: cpu 5, old 0x0, new 0x7010600070106
Skipped synchronization checks as TSC is reliable.
Booting Node 0 Processor 4 APIC 0x4
Initializing CPU#4
mce: CPU supports 0 MCE banks
x86 PAT enabled: cpu 4, old 0x0, new 0x7010600070106
Skipped synchronization checks as TSC is reliable.
Booting Node 0 Processor 7 APIC 0x7
Initializing CPU#7
mce: CPU supports 0 MCE banks
x86 PAT enabled: cpu 7, old 0x0, new 0x7010600070106
Skipped synchronization checks as TSC is reliable.

[root@sl6-1 cpu]# pwd
/sys/devices/system/cpu

[root@sl6-1 cpu]# ls
cpu0  cpu2  cpu4  cpu6  cpufreq  kernel_max  online    present
cpu1  cpu3  cpu5  cpu7  cpuidle  offline     possible
[root@sl6-1 cpu]#
[root@sl6-1 cpu]# cat online
0-7