Author: Bian Xi

Ubuntu iSCSI connect to multiple targets on boot

Ubuntu iSCSI connect to multiple targets on boot

Using iSCSI grub parameters can login to one iSCSI target at booting time, but for more than one targets, auto iSCSI session login might not be possible, at least I haven't found a way to do that.

In order to login to other multiple targets, modification need to be done in iSCSI discovered configuration

Login on boot

After discover the iSCSI targets, the targets will be in /etc/iscsi/nodes folder. Then found the correct target which in the format as below.

/etc/iscsi/nodes/<IQN>/<IP>,<Port>,1/default

Modify the above file and change following two parameters

...
node.startup = automatic
...
node.conn[0].startup = onboot
...

QEMU agent `qemu-ga` on ubuntu with high CPU utilization

QEMU agent qemu-ga on ubuntu with high CPU utilization

The qemu-ga process has 99% CPU utilization consistently.

Fix by restart

Restart qemu-qa agent

Fix by uninstall

In Proxmox VE, the qemu-guest-agent is used for mainly two things:

  • To properly shutdown the guest, instead of relying on ACPI commands or windows policies
  • To freeze the guest file system when making a backup (on windows, use the volume shadow copy service VSS).

If uninstall as the permanent solution, make sure that untick the Use QEMU Guest Agent under VM options.

References

qemu-agent 100% CPU usage
Qemu-guest-agent

Exclude files when run `rmlint`

Exclude files when run rmlint

To exclude files, using find command, then pass the parameter - to rmlint as folder name

$ find /target/dir -type f ! -name '*.nib' ! -name '*.icon' ! -name '*.plist' | rmlint [options] -

For only search specific type of file, can use following command:

find /mm -iname "*.DFF" -type f | rmlint -T df --config=sh:handler=hardlink -

References

How do I exclude/ignore specific file types/extensions with rmlint?

Update NextCloudPi

Update NextCloudPi

If go thru NextCloudPI WebUI to update NextCloudPi or NextCloud running by NextCloudPi in Docker, errors could be occurred, which can lead the user not found error. The correct way to do is recreate container using new image.

Note: /data in container must be mapped or backed up.

Update NextCloudPI Image

docker image pull ownyourbits/nextcloudpi-x86

Remove existing container

docker stop nextcloudpi
docker rm nextcloudpi

Recreate container

Use the previous docker parameter, make sure /data was mapped.

docker run -d -p 4443:4443 -p 443:443 -p 80:80 -v /app/nc/data:/data --name nextcloudpi ownyourbits/nextcloudpi-x86 $IP

Update NextCloudPi

Login to NextCloudPi, the NextCloudPi will update itself, need to wait for the process pigz completed.

Restore data from backup (If required)

Go to Backup => nc-backup-auto in NextCloudPi WebUI, to find out the backup path, and restore the latest if required.

Manual Update NextCloud

Go to Updates => nc-update-nextcloud in NextCloudPi WebUI, to update NextCloud Manually.

Install Ansible for Ubuntu

Install Ansible for Ubuntu

Install pip

Check pip installed

python3 -m pip -V

Install pip using root

apt install python3-pip

Install ansible

Install ansible using normal user

python3 -m pip install --user ansible

Note: ignore the warning message about .local/bin, the folder will be created and will be in the path after re-login

Upgrade ansible

python3 -m pip install --upgrade --user ansible

References

Installing Ansible

Update Password Life Time in Oracle Database

Update Password Life Time in Oracle Database

For testing database, disable password life time will be able to avoid following error

ORA-28002: the password will expire within 7 days

Login as sys

Using sys password (created during database instance creation) to login to sysdba

sqlplus sys@xepdb1 as sysdba

Find out profile for the user

select username, profile from dba_users where username like '<user_id>';

Check profile settings

select RESOURCE_NAME,resource_type,LIMIT from dba_profiles where PROFILE='<profile_name>';

Update profile

ALTER PROFILE <profile_name> LIMIT PASSWORD_LIFE_TIME UNLIMITED;

Check the password status

SELECT ACCOUNT_STATUS FROM DBA_USERS WHERE USERNAME='<user_id>'

Change password

# sqlplus <user_id>/<pwd>@xepdb1
...

SQL> password
Changing password for <user_id>
Old password:
New password:
Retype new password:
Password changed
SQL> quit

References

How to resolve ORA-28002: the password will expire

Convert Ubuntu VM to Proxmox

Convert Ubuntu VM to Proxmox

This is to describe how to convert Ubuntu VM to Proxmox.

VM creation

Following hardware options can be considered

  • BIOS: SeaBIOS (Should be able to see Grub menu)
  • Machine: Default (i440fx)
  • SCSI Controller: VirtIO SCSI (It might not be used as sata0 to be considered for disk)
  • Hard Disk (sata0): disk_image_file
  • Network Device (net0): vmxnet3=<mac_address> (This is default for VMware, can use other type too)

Convert the VMware disk to Proxmox disk and attach the disk to new VM

qm importdisk 121 ubuntu.vmdk pool240ssd --format qcow2

Attach the disk as sata0.

Boot

After boot up system show a GUI error screen, press Contrl + Alt + F3 to switch to console mode.

Note: Press Shift to active Grub Menu if required

Network

Find out new network interface UUID

nmcli conn

Change NetworkManager file name

cd /etc/NetworkManager/system-connections
mv Wired\ connection\ 1-<old_uuid>.nmconnection Wired\ connection\ 1-<new_uuid>.nmconnection

Update nmconnection file

[connection]
id=<new_interface_name>
uuid=<new_uuid>
type=ethernet
autoconnect-priority=-999
interface-name=<new_interface_name>
permissions=
timestamp=1628151710

[ethernet]
mac-address-blacklist=

[ipv4]
address1=192.168.1.232/24,192.168.1.254
dns=192.168.1.250;8.8.8.8;
dns-search=
method=manual

[ipv6]
addr-gen-mode=stable-privacy
dns-search=
method=disabled

[proxy]

Errors

No login GUI

After boot, only a white screen with error message appears, this was fixed by running apt update and upgrade

First, update /etc/apt/sources.list file, replace all repo URL to old-releases.ubuntu.com

Then run following commands

apt update
apt upgrade -y

References