Skip to content

Instantly share code, notes, and snippets.

View rohantmp's full-sized avatar

Rohan Joseph rohantmp

View GitHub Profile
@rohantmp
rohantmp / hpe.md
Last active September 7, 2021 14:19
lsmcli for hpe

Setup

Find appropriate rpm for your architecture here: https://support.hpe.com/hpesc/public/swd/detail?swItemId=MTX-d5125e2bff7d4e92a1b0fcebc6

$ sudo yum install -y libstoragemgmt libstoragemgmt-hpsa-plugin;
$ sudo yum install -y http://downloads.linux.hpe.com/SDR/repo/spp/RedHat/8/x86_64/current/ssacli-4.21-7.0.x86_64.rpm
$ export LSMCLI_URI=hpsa://?ssacli=$(which ssacli)

Please share the output from the following lsmcli commands:

@rohantmp
rohantmp / aws_disks.sh
Last active August 19, 2020 13:10
utility functions for attaching aws disks to OCP nodes
#!/bin/bash
# requires
# edit these
# export AWS_PROFILE
export OWNER=rojoseph
export ZONES=${ZONES:-"us-east-2a us-east-2b us-east-2c"};
export DISK_PATTERN="10 20 30 40"
aws_disks() {
#!/bin/bash -x
# This is just a modified version of hack/test_e2e.sh
# To generate: set NAMESPACE, IMAGE_LOCAL_STORAGE_OPERATOR, IMAGE_LOCAL_DISKMAKER vars and run
set -eu
ARTIFACT_DIR=${ARTIFACT_DIR:-tpjsm}
manifest=${ARTIFACT_DIR}/manifest.yaml
global_manifest=${ARTIFACT_DIR}/manifest.yaml
@rohantmp
rohantmp / ocs_cleanup.bash
Last active January 13, 2022 17:21
Instructions to forcibly cleanup OCS
#!/bin/bash
set -x
#Delete any apps consuming PVCs based on OCS storageclasses, and then delete the PVs
#Delete the StorageCluster object without deleting its dependents.
oc delete -n openshift-storage storagecluster --all --wait=true --cascade=false
#Delete the Noobaa resource.
oc delete -n openshift-storage noobaa noobaa --wait=true
#Wait for the Noobaa PVC to be automatically deleted.

Machine Config Operator docs on applying configuration

  • Find the machine MachineConfigurationPools that refer to the worker/master pools: oc get mcp --show-labels

  • Create a MachineConfig object with machineconfiguration.openshift.io/role = <MachineConfigPool Name>

  • The MCO will render a new rendered-worker-... MachineConfig and apply a rolling update of the configuration.

function FindProxyForURL(url, host) {
// use proxy for specific domains
if (shExpMatch(host, "*.test.metalkube.org"))
return "SOCKS5 localhost:8053";
// by default use no proxy
return "DIRECT";
}
@rohantmp
rohantmp / rhhi.sh
Last active May 12, 2021 13:52
dev-scripts proxy automation.
# I use ~/.ssh/config to create ssh aliases for my machines.
# script requires passwordless ssh access
# script requires tmux
# After sourcing the script, just call rhhi_cluster_env_init, this will create a proxy to the host on 8053 in a tmux session and copy the kubeconfig from the host
# Once inited, other terminals can be brought into the env using rhhi_cluster_env which sets the env vars `https_proxy` and KUBECONFIG
export RHHI_REMOTE=root@bm9
# the ocp installer asset dir
OCP_LOCATION="/root/dev-scripts/ocp/ostest"
function rhhi_cluster_env {
export https_proxy=SOCKS5://localhost:8053