You can mount samba shares ( windows or linux CIFS/samba) from an ESX box. This comes in very handy! I use it to copy on and off vmdk files when needed. Below is a example of the script I use for this. It is meant for ESX4. Earlier versions are slightly different.
#!/bin/bash
########################################################
#script to copy vmdk file to local datastore
########################################################
# enable samba client
esxcfg-firewall -e smbClient
##########################################
#make mount directory
##########################################
echo making directory /mnt/copy
mkdir /mnt/copy
###########################################
#mount samba share
##########################################
echo mounting directory to copy .vmdk file
mount -t cifs //ip or name/share /mnt/copy/ -o username=username,password=password
##########################################
#copy .vmdk files
#########################################
cp /mnt/copy/*.vmdk /vmfs/volumes/LocalStorage1/guestvm/
echo vmdk files have been copied.
#########################################
#unmount samba share
########################################
echo unmounting /mnt/copy
umount /mnt/copy
########################################################
#END script to copy vmdk file to local datastore
########################################################
Here are a couple of good links to talk about this topic:
Using Samba shares with vcbRestore on ESX Server Service Console using domain logins
Cannot mount Windows share in ESX 4.x with a mount_data version is not supported error
Connecting to a CIFS Share on a Windows Server from the Service Console
No comments:
Post a Comment