Thursday, May 5, 2016

pve 4.2 - CTs throw: "No space left on device"

When starting/stopping/restarting/status is run for a service in a CT located on a pve machine (version 4.2 is where I encountered this), the error: "No space left on device" is returned.

Question/Answer taken from: http://unix.stackexchange.com/questions/13751/kernel-inotify-watch-limit-reached

To avoid linkrot, here's that summarized:

Question:

I'm currently facing a problem on a linux box where as root I have commands returning error because inotify watch limit has been reached.

I googled a bit and every solution I found is to increase the limit with:
sudo sysctl fs.inotify.max_user_watches=<some random high number>
Answer:
  • Each used inotify watch takes up 540 bytes (32-bit system), or 1 kB (double - on 64-bit) [sources: 12]
  • This comes out of kernel memory, which is unswappable.
  • Assuming you set the max at 524288 and all were used (improbable), you'd be using approximately 256MB/512MB of 32-bit/64-bit kernel memory.
    • Note that your application will also use additional memory to keep track of the inotify handles, file/directory paths, etc. -- how much depends on its design.
To check the max number of inotify watches:
cat /proc/sys/fs/inotify/max_user_watches
To set max number of inotify watches
Temporarily:
  • Run sudo sysctl fs.inotify.max_user_watches= with your preferred value at the end.
Permanently:
  • Replace the value within the /proc/sys/fs/inotify/max_user_watches file with your own, i.e echo 524288 | sudo tee -a /proc/sys/fs/inotify/max_user_watches.
Check to see if the max number of inotify watches have been reached:
Use tail with the -f (follow) option on any old file, e.g. tail -f /var/log/dmesg: - If all is well, it will show the last 10 lines and pause; abort with Ctrl-C - If you are out of watches, it will fail with thissomewhat cryptic error:
tail: cannot watch '/var/log/dmsg': No space left on device
To see what's using up inotify watches
for foo in /proc/*/fd/*; do readlink -f $foo; done |grep inotify |cut -d/ -f3 |xargs -I '{}' -- ps --no-headers -o '%p %U %c' -p '{}' |uniq -c |sort -nr
The first column indicates used amount and the second shows the PID of that process [sources: 12].

Wednesday, April 1, 2015

Proxmox KVM - Add or remove virtual CD-ROM

While upgrading proxmox we ran into an issue loading the hardware tab of the Web-GUI for a any KVM.  To compound the problem the migration of that virtual machine was failing because of an error with the CD-ROM.  We were able to change the CD-ROM designation by logging into the Web-GUI of another server in the cluster that had yet to be upgraded but what if we couldn't?  Here is the command line way of accomplishing that task:

$ qm set <vmid> -cdrom <ISO>

To add an ISO that was uploaded to the server to vmid 100:
$ qm set 100 -cdrom /var/lib/vz/template/iso/my.iso
To set the CD-ROM to empty on vmid 100:
$ qm set 100 -cdrom none
To set the CD-ROM to use the host's physical CD drive on vmid 100:
 $ qm set 100 -cdrom cdrom

Tuesday, December 2, 2014

Sage 50 - Crystal Reports: Creating a new Database Connection

This is a set of instructions for setting up a new database connection using Crystal Reports, a software component of the Sage 50 accounting software program. 

1) Open the report you wish to create the new database connection for: 

2) Under the Database menu choose the option to "Set Datasource Location..."

3) Within this configuration, locate the option to "Create New Connection" in the "Replace with" field.

4) Under the menu for creating a new connection, locate the OLE DB (ADO) database type. Clicking on the [+] will open a new dialog box. 

5) Check the box to Use Data Link File then navigate to locate the proper Company's CrystalReports Microsoft Data Link file. (Named: CrystalReports.udl)


6) Once this file is located click Open and then Next. On the Connection Information screen enter the appropriate username/password to connect to the database. 

Finally, once this connection has been created, return to the Database menu from the menu up top and again select the Set Datasource Location...

Once you see the window for Set Datasource Location, choose the new connection you just created and click the Update button to the right of the Replace with: field. 

This needs to be done anytime a company is restored from a backup and a new CrystalReports.udl file is to be used for the newly created company. Also applies for creating a new company from scratch. 

Windows 7 - Default (Left-click) Drag and Drop Operations

(Windows 7)

Here are the situations I tested the Left-Click Drag and drop default operation - along with the resulting operation detailed:

My documents to desktop - Move
My documents to Network location - Copy
My documents to webdav - Copy

Network location to desktop - Copy
Network location to network location - Move
Network location to webdav - Copy

Webdav to desktop - Copy
Webdav to network location - Copy
Webdav to webdav - Move

I found that Left-Clicking Drag and drop operations default to MOVE when the file is being move between the same types of locations (Desktop to desktop, Network location to network location, Webdav to Webdav). Default operation is to COPY when a file is moved from one type of location to any other type of location (Desktop to network location, desktop to webdav, network location to desktop, network location to webdav, webdav to desktop, webdav to network location).

This article details all the information provided here from an official Microsoft source -- http://windows.microsoft.com/en-us/windows7/move-and-copy-files-using-drag-and-drop

This thread includes some information on how to manipulate the default operation, most notably using Right-Click http://www.overclock.net/t/646037/drag-and-drop-settings-in-windows-7

Wednesday, November 26, 2014

Google Apps - Organizations and Chat settings

This is another quick set of instructions on how to access and configure settings within the Google Admin Console. Our topic today is: Talk/Hangouts. 

First, access the Admin Console (admin.google.com)

 Navigate to Google Apps...
 Then Talk/Hangouts...
Finally the Sharing settings of Talk/Hangouts...

From here, you can select between any of your organizations created in the Admin Console to select the behavior of Talk/Hangouts. If for any reason an organization needs to have this access limited, disable Hangouts chat. Vice-versa, keep the App enabled for any organization needing access. 

The original reason I needed to know this: A user was complaining of difficulty using Chat while logged into his email. After investigating and with a ticket request from Google, I stumbled upon the settings discussed in this blog post. This user was in an organization that had it's Enable Hangouts chat disabled. Once re-enabled, chat behavior returned to normal for him. We do not recall any time that one of us (sys admins) would have gone in to specifically disable his organization, so if Chat begins behaving funny or seemingly not working: this is a good setting to check on. Cheerio.

Monday, November 24, 2014

Google Apps - Blocking a sender with Gmail

This is a quick set of instruction for where to locate the configuration for adding a domain (or user) to the blocked list for your domain when using Google Mail as your mail provider.

Access the Admin console


Select Google Apps

Select Gmail

Select User Settings


Select Blocked senders in the Spam section of User settings. This is where you will add the domain or user to block from sending to your Google Mail domain. 

You need to add a new list (I used the name of the domain I wanted to block) and then add the domain to this list. 


Select Edit on the new list created and add the domain you wish to block. 


The newly added domain will be blocked once you select Save (from the configuration) and Save Changes (in User Settings).


Tuesday, July 22, 2014

Adding multiple Network Devices to an OpenVZ CT on Proxmox

In order to configure more than one Network Device on an OpenVZ CT, we found this needed to be done in the /etc/network/interfaces file.

We created a DHCP reservation for eth0 and assigned a static IP to eth1.

auto lo
iface lo inet loopback

auto eth0 eth1
iface eth0 inet dhcp

iface eth1 inet static
address 192.168.x.x
netmask 255.255.255.x
network 192.168.x.x

This allowed connections to communicate between the two separate networks.

Some neat tricks I learned doing this one:

View user command history on an ubuntu server (in this case 12.04)
vi ~/.bash_history

Quick restart command for all networking (without being kicked out of ssh)
service networking restart