I have read several threads on configuring FTP for other machines to connect to the ESXi server. But I need to FTP my backup files (created with the ghettoVCB.sh) to our Lacie enthernet disk. The ethernet disk is embedded XP that allows FTP connections to it.
Can someone tell me how to FTP from the ESXi machine?
Thanks!
Charles
Not sure about ESXi 3.5, but on ESXi 4.0 there is an FTP client,l as mentioned you need to get into the unsupported busybox console:
~ # vmware -v VMware ESXi 4.0.0 build-171294
ftpget
~ # ftpget BusyBox v1.9.1-VMware-visor-654 (2008-12-17 10:01:32 PST) multi-call binary Usage: ftpget [options] remote-host local-file remote-file Retrieve a remote file via FTP Options: -c,--continue Continue previous transfer -v,--verbose Verbose -u,--username Username -p,--password Password -P,--port Port number
ftpput
~ # ftpput BusyBox v1.9.1-VMware-visor-654 (2008-12-17 10:01:32 PST) multi-call binary Usage: ftpput [options] remote-host remote-file local-file Store a local file on a remote machine via FTP Options: -v,--verbose Verbose -u,--username Username -p,--password Password -P,--port Port number
=========================================================================
William Lam
VMware vExpert 2009
VMware ESX/ESXi scripts and resources at:
VMware Code Central - Scripts/Sample code for Developers and Administrators
If you find this information useful, please award points for "correct" or "helpful".
Did you use a local datastore or an NFS datastore? If you used local look at setting up an NFS datastore. You then have many options for moving / copying your data.
There are directions etc for adding ftp to ESXi on vm-help.com but I would suggest that the more you add as services to the ESXi host the more chance you have of making the host unstable.
You would have to enable the hidden console to use the builtin ftp client. Have a look at this link.
http://professionalvmware.com/2009/05/unsupported-console-and-ssh-on-esxi-4/
If you found this or any other answer useful please consider the use of the Helpful or correct buttons to award points
I used the ghettoVCB sh to make a copy of the VM files locally. Unfortunately the Lacie disk device does not support NFS. So I am trying to FTP the files to the Lacie disk. I looked at the vm-help.com site and I must be missing something because I don't see and information on using FTP from the esxi console.
I have enabled the hidden console. I can't find any info on the "builtin ftp client" you mentioned.
Once you have enabled the ssh console on the ESXi server you can use fastscp or winscp to secure ftp in to your ESXi host and grab your files.
Tom
Right! but I am trying to FTP them from the esxi host to the Lacie disk. This way I can script the transfer to happen via scheduled job. So I really need outgoing FTP is what I trying to say I suppose. Sorry if this wasnt clear.
I do not believe there are any FTP binaries on the ESXi host. Your only option would be to ftp to the host from your desktop, grab the files, then from your desktop put them on your Lacie.
Is there anyway to install FTP binaries to the ESXi host?
Not that I'm aware of.
Not sure about ESXi 3.5, but on ESXi 4.0 there is an FTP client,l as mentioned you need to get into the unsupported busybox console:
~ # vmware -v VMware ESXi 4.0.0 build-171294
ftpget
~ # ftpget BusyBox v1.9.1-VMware-visor-654 (2008-12-17 10:01:32 PST) multi-call binary Usage: ftpget [options] remote-host local-file remote-file Retrieve a remote file via FTP Options: -c,--continue Continue previous transfer -v,--verbose Verbose -u,--username Username -p,--password Password -P,--port Port number
ftpput
~ # ftpput BusyBox v1.9.1-VMware-visor-654 (2008-12-17 10:01:32 PST) multi-call binary Usage: ftpput [options] remote-host remote-file local-file Store a local file on a remote machine via FTP Options: -v,--verbose Verbose -u,--username Username -p,--password Password -P,--port Port number
=========================================================================
William Lam
VMware vExpert 2009
VMware ESX/ESXi scripts and resources at:
VMware Code Central - Scripts/Sample code for Developers and Administrators
If you find this information useful, please award points for "correct" or "helpful".
Wow! that's it!
works great.
Thanks sooo much.
Charles
Wow, I learned something new!
Here is a script that may be helpful. it uses the output of vim-cmd /vmsvc/getallvms, the parameter you provide will be matches against this output. Be sure you setup the backup directory with the proper access and directory names that match the vmname (2nd field in the getallvms output) as data will be stored there. The script will stop all running VMs that will be backed up and start them again (if they where running in the first place). It will not start VMs that where not running.
Sorry that the indents are not copied in correctly, had to lose the comments as well as the posting does funny things with it:
#!/bin/sh
VERSION=1.1
if ; then
echo "Usage: $0 vmname"
exit 1
fi
SERVNAME=$1
BACKUPHOST=<hostname or ip>
BACKUPUSER=<vmbackup_ftp_user>
BACKUPPW='password'
BACKUPDIR='/vmbackup'
VMID=`vim-cmd /vmsvc/getallvms | grep -v "^Vmid" | grep "$SERVNAME" | awk '{ print $1 }'`
VMNAME=`vim-cmd /vmsvc/getallvms | grep -i "^$j " | awk '{ print $2 }'`
VMSTAT=`vim-cmd /vmsvc/power.getstate $j | grep Powered | awk '{ print $2 }'`
VMDATASTORE=`vim-cmd /vmsvc/get.datastores $j | grep url | awk '{ print $2 }'`
VMLOCATE="$VMDATASTORE/$VMNAME"
echo "Location: $VMLOCATE"
echo "Name : $VMNAME"
ALLFILES=`ls -1 $VMLOCATE`
VMSTAT=`vim-cmd /vmsvc/power.getstate $j | grep Powered | awk '{ print $2 }'`
if ; then
echo "Server $VMNAME with VMID $j is already powered off"
else
echo "Powering off server $VMNAME with ID $j"
vim-cmd /vmsvc/power.shutdown $j
VMSTAT=on
echo "Checking status (now $VMSTAT)"
while ; do
echo wait for $VMNAME to shutdown..
sleep 10
VMSTAT=`vim-cmd /vmsvc/power.getstate $j | grep Powered | awk '{ print $2 }'`
done
VMSTAT=on
fi
for i in $ALLFILES; do
echo backup $VMLOCATE/$i to $BACKUPDIR/$VMNAME/$i on $BACKUPHOST
ftpput -u $BACKUPUSER -p $BACKUPPW $BACKUPHOST $BACKUPDIR/$VMNAME/$i $VMLOCATE/$i
done
if ; then
vim-cmd /vmsvc/power.on $j
fi
done
You should add this to a new post so it isn't lost.
I am new to this, so where would I do that?
There are several places you could post it. Make a new post in this forum. Back forum, developer forum?? have a look through.
Hello, nice script you made.
I tried it on my ESXi (VSphere) but i can´t get it to work.
Just typed the Vm-machinename after the script.
-
-
/bin # sh backup.sh VmTestBackup
Insufficient arguments.
Insufficient arguments.
Location: /
Name :
Insufficient arguments.
Powering off server with ID
Insufficient arguments.
Usage: power.shutdown vmid
Shutdown the guest OS
Checking status (now on)
wait for to shutdown..
Insufficient arguments.
You can wrap your script in tags to make the script readable.
A link to the forum markup language.