Showing posts with label scp. Show all posts
Showing posts with label scp. Show all posts

Tuesday, 30 April 2013

ESXi: how to install virtual machine using VMware vSphere Client

In earliest post, I demoed How to install VMware ESXi 5.1 and vSphere Client.
This articles will show how to create and virtual machine and install centos as guest OS on ESXi host.

1. Login to VMware vSphere Client

2. Click "File -> New -> Virtual Machine .." or press ctrl-N.













3. Choose Typical configuration.









4. Specify a name for our virtual machine, here I put "vmcentos".








5.  Choose guest OS and version, I am installing centos, so choose "Linux" and "CentOS 4/5/6 (32bit)"










6. Create a disk, I am installing Centos minimal, 5G should be more than enough, leave the other option unchanged.









7. Review VM configurations before finishing, attach CD/DVD to the virtual machine. Earlier I have copied CentOS-6.3-i386-minimal.iso into ESXi using winscp, so I just attach the iso file. Under "device status" remember to check "connect at power on" , otherwise VM cannot boot up properly in step 9.














 



8. Open VM console: "Inventory -> Virtual Machine -> Open Console"











9. Press green button to boot up VM, alternatively you can click "Inventory -> Virtual Machine -> Power -> Power On" .














10. Once we see the CentOS  installation page, the following steps should be no difference from installing a physical machine.

Friday, 4 May 2012

Copy files from one server to another

In my work, I often need to copy files or whole directories between different servers. These are the ways I used often:

1. scp
scp -r directory remote:/path/to/directory

2. tar + ssh
tar -zcpf - directory | ssh remote tar -zxpf \
-C /path/to/directory
in Solaris, there is no -C -z flag, so I use:
tar -cpf - directory | ssh remote \
"(cd /path/to/directory; tar -xpf -)"

3. rsync over ssh
I have a central server, everyday there are some new files generated in one directory. I need to push this directory to remote servers everyday.
It's possible to schedule some cronjob to scp or tar + ssh this directory, But it will copy the whole directory everyday. To use rsync, we only need to copy the changes to this directory.
rync -e ssh -az --delete directory \
remote:/path/to/directory

4. nc + tar
A few years ago, I need to copy huge amount of data to a remote data center in another country, while exploring ways to copy the data, I found this utility nc.
But nc doesn't encrypt the data, I only tested it within the same data center.

on remote server:
cd /path/to/directory
nc -l -p 8888 | tar -zxvf -

on source server:
tar -czf - directory | nc remote 8888

on the remote server, I used -v flag, so I could monitor the copying progress.