Compute instance - davidkhala/oci-collection GitHub Wiki
hostnamectl
info
- Hardware Vendor: QEMU
- Hardware Model: KVM Virtual Machine
requires
- Enable Plugin
Compute Instance Run Command
managed by Oracle Cloud Agent - IAM:
Allow dynamic-group <instance principal dynamic group> to use instance-agent-command-execution-family in TENANCY where request.instance.id=target.instance.id
- Debug by
tail -f /var/log/oracle-cloud-agent/plugins/runcommand/runcommand.log
Reference
- Debug by
Troubleshoot
- log in
tail -f /var/log/oracle-cloud-agent/plugins/runcommand/runcommand.log
sudo systemctl restart oracle-cloud-agent
limitation
- instance use a systemd service(oracle-cloud-agent) to poll command, but the interval is 180s
- Supported OS [Oracle Linux, CentOS, Windows Server]. Ubuntu are NOT supported
- timeout for a script: The default is one hour. The maximum is 24 hours.
- Default parrallel: 2, up to 5 maximum
- To change the default, update the run command configuration file in
cat /etc/oracle-cloud-agent/plugins/runcommand/config.yml
- To change the default, update the run command configuration file in
- Command orchestration is not supported.
Endpoints
- curl http://169.254.169.254/opc/v1/instance/
- curl http://169.254.169.254/opc/v1/instance/metadata/
- curl http://169.254.169.254/opc/v1/instance/metadata/<"key-name">/
oci cli extention
oci-metadata --json
Oracle Linux
sudo dd iflag=direct if=/dev/oracleoci/oraclevda of=/dev/null count=1
echo "1" | sudo tee /sys/class/block/`readlink /dev/oracleoci/oraclevda | cut -d'/' -f 2`/device/rescan
After console connection established, you are required to input login password, then before console connection, you need to change password of user in advanced in normal terminal. If you haven't do so:
-
Ubuntu 20
- Reboot the instance from the Console while keep Console Connection terminal open
- When the reboot process starts, in the terminal window, press
Esc
once only after stop completed and a blank cursor flashing-
F5
is the browser default Refresh shortcut - If click
Esc
repeatedly too early, it will go toBoot Manager
console, then you have to try again - If click
Esc
repeatedly, you will go too far toGRUB
command mode. In this case, runnormal
command to back to GRUB console mode
-
-
E
to edit the grub entryubuntu
. - In edit mode, use the down arrow key to scroll down through the entries until you reach the line that starts with
linuxefi
orlinux
. - Add
init=/bin/bash
to end of that line - save the temporary change by entering the keyboard shortcut CTRL+X. Your change will not persist in next boot
- Remount filesystem for root in rescue mode.
/bin/mount -o remount, rw /
- [ready to use here. Do your task]
- Post-task, run
exec /usr/lib/systemd/systemd
- Reboot from command.
/usr/sbin/reboot -f
-
Oracle Linux
-
SUSE