From e1d69bbcf25880c54b2f988c493fa7071849fdd4 Mon Sep 17 00:00:00 2001 From: Malin Freeborn Date: Tue, 20 Jun 2023 15:19:26 +0200 Subject: [PATCH 1/3] place proper variables in xen notes --- virtualization/xen/xe.md | 47 ++++++++++++++++---------------- virtualization/xen/xen_basics.md | 11 ++++++-- 2 files changed, 32 insertions(+), 26 deletions(-) diff --git a/virtualization/xen/xe.md b/virtualization/xen/xe.md index fc27de8..43b96da 100644 --- a/virtualization/xen/xe.md +++ b/virtualization/xen/xe.md @@ -8,22 +8,24 @@ tags: [ "documentation", "virtualization", "xen" ] xe vm-list ``` -Start, stop, et c. all done with `xe`: +Start, stop, et c. with `xe`: ```bash -xe vm-start vm=*TTS* +xe vm-start vm=$TARGET_VM ``` ```bash -xe vm-shutdown vm=*Bob* +xe vm-shutdown vm=$TARGET_VM ``` Destruction requires the uuid. ```bash -xe vm-destroy uuid=*243b1165-14aa-37f6-496f-44879d05b3f2* +xe vm-destroy uuid=$TARGET_UUID ``` +Autocompletion works well with all of these commands. + # Shut Down VM List VMs. @@ -33,17 +35,17 @@ xe host-list ``` ```bash -xe vm-list resident-on=** +xe vm-list resident-on=$HOST_UUID ``` ```bash -xe vm-shutdown uuid=** force=true +xe vm-shutdown uuid=TARGET_VM force=true ``` If this doesn't work, try: ```bash -xe vm-reset-powerstate uuid=** force=true +xe vm-reset-powerstate uuid=TARGET_VM force=true ``` Get the id: @@ -55,16 +57,14 @@ list_domains And destroy the domain: ```bash -/opt/xensource/debug/xenops destroy_domain -domid ** +/opt/xensource/debug/xenops destroy_domain -domid $DOM_ID ``` -# Error: `Internal error:xenopsd internal error: Storage_interface.Illegal_transition` in XenServer +# Problem Solving -## Symptoms or Error +> Error: `Internal error:xenopsd internal error: Storage_interface.Illegal_transition` in XenServer -After a failed “Move VM”, “Copy VM”, or “Export VM” operation, the Virtual Machine (VM) being operated cannot start. Following is the error message displayed: - -`User-added image` +After a failed “Move VM”, “Copy VM”, or “Export VM” operation, the Virtual Machine (VM) being operated cannot start. ## Solution @@ -85,32 +85,34 @@ This is the UUID of the Control Domain. The Control Domain is a privileged Virtu Run the following command to obtain the UUID of the VBD (Virtual Block Device) object linking the Control Domain: ```bash -xe vbd-list vm-uuid=** +xe vbd-list vm-uuid=$CONTROL_DOMAIN_UUID ``` Run the following commands to unplug and destroy the VBD: ```bash -xe vbd-unplug uuid=** +xe vbd-unplug uuid=$VBD_UUID ``` ```bash -xe vbd-destroy uuid=** +xe vbd-destroy uuid=$VBD_UUID ``` -## Make a local iso repository +# Make a local iso repository ```bash xe sr-create name-label=LocalISO type=iso device-config:location=/var/opt/xen/ISO_Store device-config:legacy_mode=true content-type=iso ``` -This creates a UUID for the new directory: +This creates a UUID for the new directory, e.g.: -`e94e25bb-bcdc-801b-b62a-b51b686a3bdc` +> e94e25bb-bcdc-801b-b62a-b51b686a3bdc # Import -xe vm-import filename=*/mnt/blah.xva* +```bash +xe vm-import filename="$FILENAME".xva +``` # USB @@ -151,11 +153,10 @@ xe sr-list # Exporting and Exporting VMs ```bash -xe vm-export vm=** filename=*/full/path.xva* +xe vm-export vm=$VM_NAME filename="$FULL_PATH".xva ``` ```bash -xe vm-import vm=** filename=*/full/path.xva* +xe vm-import vm=** filename="$FULL_PATH".xva ``` - diff --git a/virtualization/xen/xen_basics.md b/virtualization/xen/xen_basics.md index 8ab361a..58a5a4b 100644 --- a/virtualization/xen/xen_basics.md +++ b/virtualization/xen/xen_basics.md @@ -4,17 +4,22 @@ tags: [ "Documentation", "xe", "virtualization", "volume" ] --- # Make a local iso repository + ```bash -mkdir -p */var/opt/xen/ISO_Store* +STORE_PATH=/var/opt/xen/ISO_Store ``` ```bash -xe sr-create name-label=*LocalISO* type=iso device-config:location=*/var/opt/xen/ISO_Store* device-config:legacy_mode=true content-type=iso +mkdir -p $STORE_PATH +``` + +```bash +xe sr-create name-label="$STORAGE_NAME" type=iso device-config:location=$STORE_PATH device-config:legacy_mode=true content-type=iso ``` This creates a UUID for the new directory: -`e94e25bb-bcdc-801b-b62a-b51b686a3bdc` +> e94e25bb-bcdc-801b-b62a-b51b686a3bdc # Main Console From 981778a89150eed8c06028ab189df3dd604f1c57 Mon Sep 17 00:00:00 2001 From: Malin Freeborn Date: Tue, 27 Jun 2023 23:06:05 +0200 Subject: [PATCH 2/3] add new file script --- new.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 new.sh diff --git a/new.sh b/new.sh new file mode 100755 index 0000000..16867d0 --- /dev/null +++ b/new.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +echo Select a category + +category="$(find . -type d -printf '%P\n' | fzy)" + +[ ! -d "$category" ] && mkdir "$category" + +echo Select a name + +read name + +filePath="$category/$name.md" + +tagsList="$(echo \"$category | sed 's#\/#", "#g')\"" + +[ -e "$filePath" ] && $EDITOR $filePath && exit 0 + +echo "--- +title: \"$name\" +tags: [ $tagsList ] +--- + +" > "$filePath" + +$EDITOR "$filePath" + From 38d633ad7fce97adcc045b437276c55068135f44 Mon Sep 17 00:00:00 2001 From: Malin Freeborn Date: Tue, 27 Jun 2023 23:49:55 +0200 Subject: [PATCH 3/3] include void background script --- distros/void/void-background.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 distros/void/void-background.sh diff --git a/distros/void/void-background.sh b/distros/void/void-background.sh new file mode 100755 index 0000000..83f4e86 --- /dev/null +++ b/distros/void/void-background.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# get the void linux logo from wikipedia +wget https://upload.wikimedia.org/wikipedia/commons/thumb/0/02/Void_Linux_logo.svg/256px-Void_Linux_logo.svg.png?20170131170632 +# rename it, and resize it (the standard size is too small for most wallpapers) +convert -resize 200% '256px-Void_Linux_logo.svg.png?20170131170632' void-logo.png +# download a pretty wallpaper +wget http://wallpapercave.com/wp/Wlm9Gv0.jpg + +# put the void logo on all *jpg and *png images +for x in *.jpg + do + composite -compose multiply -gravity Center void-logo.png "$x" "$x" +done