PROXMOX 新增第二顆硬碟

SDA is the drive where the proxmox installation is running
SDB is the new drive that will be added to the proxmox.

Open the Proxmox Shell
With fdisk you can find your drives that you want to add, if you are not sure what the device name is for your hard drive that you want to add.

Type: fdisk -l

Find the “Disk" with no valid partition table. That will be probably your hard drive you want to add.

“Disk /dev/sdb doesn’t contain a valid partition table"
To make a partion on the new drive type the following:

Type: cfdisk /dev/sdb

Choose the following options:

New  –>  Primary  –>  Specify size in MB
Write
Quit

Now a physical volume has to be created.

Type: pvcreate /dev/sdb1

Create a volume group. The name “Data-Storage" is an example. You can name it anyway you want. Consider a logical name, because this is the name that will be used in the proxmox web interface:

Type: vgcreate Data-Storage /dev/sdb1

Add the storage in ProxMox
–       In the webinterface click on the directory Datacenter and then click on tab Storage.

–       Click Add – LVM Group

o    Type an ID Name for example data-storage

 

o    Base Storage: Existing Volume Groups

 

o    Volume Group: Data-Storage

 

o    Enabled: Checked
o    Other options should be adjusted accordenly to what you want with it.
Now the extra storage has been added in Proxmox and ready for use.

Debian 安裝 rsync Server

# apt install rsync
# nano /etc/rsyncd.conf

------------------------------------------------------------------------------------# sample rsyncd.conf configuration file

# GLOBAL OPTIONS

#motd file=/etc/motd
log file=/var/log/rsyncd.log
# for pid file, do not use /var/run/rsync.pid if
# you are going to run rsync out of the init.d script.
# The init.d script does its own pid file handling,
# so omit the "pid file" line completely in that case.
pid file=/var/run/rsyncd.pid
#syslog facility=daemon
#socket options=

# MODULE OPTIONS

[myrsync]

comment = public archive
path = /myrsync
use chroot = yes
# max connections=10
lock file = /var/lock/rsyncd
# the default for read only is yes...
read only = no
list = yes
uid = nobody
gid = nogroup
# exclude =
# exclude from =
# include =
# include from =
auth users =admin
secrets file = /etc/rsyncd.secrets
strict modes = yes
# hosts allow =
# hosts deny =
ignore errors = yes
ignore nonreadable = yes
transfer logging = yes
# log format = %t: host %h (%a) %o %f (%l bytes). Total %b bytes.
timeout = 600
refuse options = checksum dry-run
dont compress = *.gz *.tgz *.zip *.z *.rpm *.deb *.iso *.bz2 *.tbz
--------------------------------------------------------------
# nano /etc/rsyncd.secrets
# nano /etc/default/rsync
#chown root:root /etc/rsyncd.secrets
#chmod 600 /etc/rsyncd.secrets
#/etc/init.d/rsync start


在Linux client 到 Rsync Server:
rsync -avzrHS --delete /sftpserver/uploadrsync/ hotai@s2.ice.com.tw::uploadrsync

XENSERVER6.5 0 安裝 LINUX AGENT TOOLS

  • mount /dev/cdrom /mnt
  • bash /mnt/Linux/install.sh
  • umount /dev/cdrom

    1. The files required are present on the built-in xs-tools.iso CD image, or alternatively can be installed

by using the VM > Install XenServer Tools option in XenCenter.
2. Mount the image onto the guest by running the command:
mount -o ro,exec /dev/disk/by-label/XenServer\\x20Tools /mnt
Note:
If mounting the image fails, you can locate the image by running the following:
blkid -t LABEL="XenServer Tools"
3. Execute the installation script as the root user:
/mnt/Linux/install.sh
4. Unmount the image from the guest by running the command:
umount /mnt
5. If the kernel has been upgraded, or the VM was upgraded from a previous version, reboot the VM now.
Note:
CD-ROM drives and ISOs attached to Linux Virtual Machines appear as devices, such as /
dev/xvdd (or /dev/sdd in Ubuntu 10.10 and later) instead of as /dev/cdrom as you
might expect. This is because they are not true CD-ROM devices, but normal devices. When
the CD is ejected by either XenCenter or the CLI, it hot-unplugs the device from the VM
and the device disappears. This is different from Windows Virtual Machines, where the CD
remains in the VM in an empty state.

XenServer 移除 local storage

1. log in to your xenserver host via ssh

Use your favourite SSH program I prefer using  MTPuTTY myself.

2.List your storage repositories.

type xe sr-list to get the UUID from the local share you want to remove.

You will see something like this:

uuid ( RO) : 62aac8ce-f974-9ecc-5a6f-6e601fcef97a
name-label ( RW): Local storage
name-description ( RW):
host ( RO): xenghetto.sitedevelopments.local
type ( RO): lvm
content-type ( RO): user

uuid string is the Storage Repository uuid (SR-uuid) that you need to be able to do the next step.

name-label This is the name of the local storage so check if that corresponds to the local storageyou want to detach before you go to the next step.

Step 3. Get the Physical Block Device UUID.

Now it’s time to get the Physical Block Device (PBD):

You find that by typing:  xe pbd-list sr-uuid=Your-UUID

[root@xenghetto # xe pbd-list sr-uuid=62aac8ce-f974-9ecc-5a6f-6e601fcef97a
uuid ( RO)                  : 47127040-7e77-749c-ce24-49d33b9df232
host-uuid ( RO): 4b3c5ae2-6b22-4972-bea5-9467b25f519d
sr-uuid ( RO): 62aac8ce-f974-9ecc-5a6f-6e601fcef97a
device-config (MRO): device: /dev/disk/by-id/scsi-SATA_INTEL_SSDSC2CT0CVMP2156091M060AGN-part3
currently-attached ( RO): true

uuid ( RO) This is the PBD-uuid write this down and lets unplug the local storage.

Step 4. Unplug the local storage.

To unplug the local storage you type the following:

xe pbd-unplug uuid=Your-PBD-uuid

In my case it’s:

xe pbd-unplug uuid=47127040-7e77-749c-ce24-49d33b9df232

it should now be unplugged. you can check that in xencenter.

Step 5.Delete the PBD:

xe pbd-destroy uuid=your-PBD-uuid

in my case it’s

xe pbd-destroy uuid=47127040-7e77-749c-ce24-49d33b9df232

if you go to xencenter you will now see that it’s fully detached:detached localstorage

6. Forget ( remove ) the Local storage from showing up as detached.

xe sr-forget uuid=your-SR-uuid

xe sr-forget uuid=62aac8ce-f974-9ecc-5a6f-6e601fcef97a

Now check your XenCenter that it’s removed.

done-removing-localstorage

如何安裝 VMware Tools on Debian, Ubuntu and CentOS with Command Line

Today we use virtualization for both development, testing and also production. One of the most popular virtualization solution is VMware. There are many products that we can use for free such as VMware Playeror VMware vSphere Hypervisor (ESXi).

If you want Guest OS to be fully working in VMware products, you must install VMware Tools that will give better virtualization support such as you can move mouse better without have to press Ctrl + Alt to get out from Guest OS. Or in Linux Server that don't have GUI, Host OS can read or change some value from Guest OS such as IP Address.

Install VMware Tools on Windows OS will be very easy as install normal software. But this article will help you to install VMware Tools on Linux Server that have only CLI for you. In principle you must have compiler and linux headers so you can go smooth with installing VMware Tools.

置放 VMware Tools 光碟

This step will be the same for Debian, Ubuntu and CentOS

If you use VMware Workstation go to VM > Install VMware Tools...

/system/files/vmware-tools/vmware-tools-01.png

如果你使用 VMware vSphere Hypervisor (ESXi) go to VM > Guest > Install/Upgrade VMware Tools

/system/files/vmware-tools/vmware-tools-02.png

安裝 VMware Tools on Debian

We must log in with root user. It is better if we start with update all the software in system first then reboot one time.

apt-get update && apt-get dist-upgrade
shutdown -r now

Install compiler and Linux Header with command

apt-get update && apt-get install build-essential linux-headers-$(uname -r) libglib2.0-0

Mount VMware Tools disc and extract file

mount /dev/cdrom /mnt
tar xvfz /mnt/VMwareTools-*.tar.gz -C /tmp/

Start installing VMware Tools with command

perl /tmp/vmware-tools-distrib/vmware-install.pl

Then press Enter to all the questions to use all default answer. Then reboot again and it will be done.

shutdown -r now

安裝 VMware Tools on Ubuntu

We must log in with user that has sudo privilege. It is better if we start with update all the software in system first then reboot one time.

sudo apt-get update && sudo apt-get dist-upgrade
sudo shutdown -r now

Install compiler and Linux Header with command

sudo apt-get update && sudo apt-get install build-essential linux-headers-$(uname -r)

Mount VMware Tools disc and extract file

sudo mount /dev/cdrom /mnt
sudo tar xvfz /mnt/VMwareTools-*.tar.gz -C /tmp/

Start installing VMware Tools with command

sudo perl /tmp/vmware-tools-distrib/vmware-install.pl

Then press Enter to all the questions to use all default answer. Then reboot again and it will be done.

sudo shutdown -r now

安裝 VMware Tools on CentOS

We must log in with root user. It is better if we start with update all the software in system first then reboot one time.

yum update
shutdown -r now

Install compiler and Linux Header with command

yum install gcc perl

Mount VMware Tools disc and extract file

mount /dev/cdrom /mnt
tar xvfz /mnt/VMwareTools-*.tar.gz -C /tmp/

Start installing VMware Tools with command

perl /tmp/vmware-tools-distrib/vmware-install.pl

Then press Enter to all the questions to use all default answer. Then reboot again and it will be done.

shutdown -r now