Ask Your Question

tbodine's profile - activity

2018-04-08 16:47:12 -0500 received badge  Famous Question (source)
2016-04-10 23:47:49 -0500 received badge  Famous Question (source)
2016-03-21 09:09:55 -0500 received badge  Notable Question (source)
2015-11-25 00:58:54 -0500 received badge  Notable Question (source)
2015-11-03 16:33:21 -0500 received badge  Famous Question (source)
2015-11-03 07:34:41 -0500 received badge  Popular Question (source)
2015-10-26 08:05:21 -0500 answered a question how can I boot a snapshot with same network interfaces as the original virtual machine?
  1. While the system is up a. generate a table of virtual machines, internet protocol addresses, flavors and security groups b. take a snapshot of each virtual machine.

    1. At Recovery time for each virtual machine in the table

Nova boot -flavor {flavor} -image {vmsnapshot} -security-groups {secgroups} -nic net-id={net-id},v4-fixed-ip={ip} vmname

restart services on virtual machine

2015-10-26 07:59:24 -0500 commented answer how can I boot a snapshot with same network interfaces as the original virtual machine?

This is a way relying on floating internet protocol addresses. I felt a need to restore the virtual machines in a way where the new ones would have the same fixed internet addresses as the old ones.

2015-10-22 14:22:00 -0500 asked a question how can I boot a snapshot with same network interfaces as the original virtual machine?

Is there a way where I can nova boot a snapshot and assign an ip?

For instance I have a virtual machine running, i have taken a snapshot of it and the Openstack infrastructure fails, when the infrastructure is up again, I want to relaunch the snapshot with the same internet protocol address as the original virtual machine.

I can see a way for fixed addresses, but for floating ip how could I do it?

2015-10-14 09:09:27 -0500 received badge  Notable Question (source)
2015-10-14 09:09:27 -0500 received badge  Famous Question (source)
2015-09-22 12:40:07 -0500 answered a question UnicodeEncodeError 'ascii' codec can't encode character with Keystone

This is my least favorite error. Its related to https://ask.openstack.org/en/question...

Basically the openstack api has issued a character Latin Small Letter E With Circumflex.

2015-09-18 04:09:53 -0500 received badge  Popular Question (source)
2015-09-15 10:43:34 -0500 commented answer Windows 7 Console Unicode errors

Ok so the work around was that nova image-list didn't have those pesky unicode characters in its output while glance did, but now that I've upgraded to nova 2.28.1 they appear, so now I can no longer list images in windows, fortunately there is an ubuntu machine I can use.

2015-09-15 10:40:03 -0500 received badge  Famous Question (source)
2015-09-15 09:20:46 -0500 received badge  Famous Question (source)
2015-09-15 05:58:53 -0500 received badge  Popular Question (source)
2015-09-15 05:58:53 -0500 received badge  Notable Question (source)
2015-09-15 05:58:53 -0500 received badge  Popular Question (source)
2015-09-14 15:18:46 -0500 answered a question How to display a date sorted list of images with date field

Works great, here's the output:

 2014-08-26T12:09:11  RHEL-6.5
 2014-09-06T14:27:40  cirros-0.3.2-x86_64
 2014-09-08T09:13:27  ICFPP_IMAGE
 2014-10-08T14:01:16  ICFPP_IMAGE_100GB_Oct2014
 2014-10-27T10:37:42  trusty-server-cloudimg-amd64-disk1.img1414403314246
 2014-11-14T18:00:51  windows-2012-r2-std_2014-11-14-v6
 2014-11-14T18:09:17  windows-2008-r2-std_2014-11-14-v6
2015-09-14 15:14:50 -0500 received badge  Notable Question (source)
2015-09-14 15:12:21 -0500 asked a question Why in glance 1.0.0 do I get this error "error: unrecognized arguments: --is-public True" ?

Because the interface is changed,

it is now

glance --visibility [public|private] ...

instead of

glance [--is-public=True|--is-public=False ] ...
2015-09-11 07:40:40 -0500 received badge  Enthusiast
2015-09-10 16:19:35 -0500 received badge  Good Answer (source)
2015-09-10 11:47:50 -0500 received badge  Nice Answer (source)
2015-09-10 11:26:56 -0500 received badge  Supporter (source)
2015-09-10 10:46:19 -0500 received badge  Teacher (source)
2015-09-10 10:21:51 -0500 answered a question How does an instance with flavor m1.nano (disk = 0, RAM =64) has disk.usage >0 ?

Probably a ramdisk, what does df show?

2015-09-10 10:19:39 -0500 answered a question How to gracefully terminate instance in Openstack?

I'll agree with Eduardo Gonzalez. On a host that has the openstack command line utilitities communicating with your openstack for a Linux instance

echo sudo shutdown now |ssh -i yourkey.pem cloud-user@yourinstance
sleep 60
nova delete  yourinstance
2015-09-10 09:47:37 -0500 answered a question Nova 2.28.1 ERROR (AttributeError): 'module' object has no attribute 'TCP_KEEPCNT'

In "c:\Python27\Lib\site-packages\keystoneclient\session.py" around line 934 are the offending lines

   def init_poolmanager(self, *args, **kwargs):
    if 'socket_options' not in kwargs:
        socket_options = [
            # Keep Nagle's algorithm off
            (socket.IPPROTO_TCP, socket.TCP_NODELAY, 1),
            # Turn on TCP Keep-Alive
            (socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1),
            # Set the maximum number of keep-alive probes
            (socket.IPPROTO_TCP, socket.TCP_KEEPCNT, 4),
            # Send keep-alive probes every 15 seconds
            (socket.IPPROTO_TCP, socket.TCP_KEEPINTVL, 15),
        ]

These should be changed to def init_poolmanager(self, *args, kwargs): if 'socket_options' not in kwargs: socket_options = [ # Keep Nagle's algorithm off (socket.IPPROTO_TCP, socket.TCP_NODELAY, 1), # Turn on TCP Keep-Alive (socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1), # Set the maximum number of keep-alive probes #(socket.IPPROTO_TCP, socket.TCP_KEEPCNT, 4), # Send keep-alive probes every 15 seconds #(socket.IPPROTO_TCP, socket.TCP_KEEPINTVL, 15), ]

Probably should be fixed to check for the existence of these objects before trying to set them, but just commenting the code out works fine.

2015-09-10 09:41:03 -0500 asked a question Nova 2.28.1 ERROR (AttributeError): 'module' object has no attribute 'TCP_KEEPCNT'

Just up graded to nova 2.28.1 on windows 7 and I get the error

ERROR (AttributeError): 'module' object has no attribute 'TCP_KEEPCNT'

How do I solve this problem?

2015-09-02 03:02:50 -0500 received badge  Popular Question (source)
2015-08-31 09:18:16 -0500 commented question What steps should I follow to reduce the size of an image

Please illustrate how I can take this image which has everything I need but 46GB of space I don't want and create a new image from it that takes up just 4G?

2015-08-28 09:59:22 -0500 asked a question What steps should I follow to reduce the size of an image

I have a rhel6 linux image of 50GB. The actual OS takes up only 3G so I want to reduce the amount of space it takes up.

I tried this method which fails to yield a bootable image.
1. launch ubuntu
2. attach a 100GB volume
3. glance image-down load the rhel6 image to the attached volume
4. qemu-img convert the rhel6 image to raw
5. attach another 100GB volume
6. dd the raw file to the newly attached volume
7. reboot the ubuntu server
8. run e2fsck on the newly created slice
9. resize2fs newslice 3G
10. fdisk new-slice
   a. delete old partition table
   b. add partition 1, make it 3G
   c. set bootable flag
   d. write table
11. mount newslice
12. discover that all the files are there
13. umount newslice
14. dd if=newvolume of=newimage.raw bs=512
15. qemu-img convert newimage.raw newimage.qcow2
16. glance image-create --name newimage --file newimage.qcow2 --disk qcow2 --container bare

when I try to nova boot newimage I get thiserror:

mount: wrong fs type, bad option, bad superblock on /dev/vda1
[ 2.7...] dracut Warning: Boot has failed

2015-08-04 12:54:34 -0500 answered a question how to launch an instance and deploy our Java Application in it
  1. Install the commandline utilities to your desktop
  2. launch a virtual machine with your favorite distribution
  3. log in to the virtual machine
  4. excute "runlevel", you'll get an answer like "N 2"
  5. add a script in /etc/rc2.d/S98myJavaApp (assuming the default run level is 2) Put the commands here that will start your app such as "java -jar /home/javaGuy/java/javapp.jar"
  6. reboot the virtual machine, and check that your app starts
  7. take a snap shot with nova image-create virtualMachineName javaImageName

After this you can launch it in this way

#Define flavor
image="javaImageName"
#define securityGroups
#define network
command = StringFormat ("nova boot --flavor %s --image %s --key_name %s --security-groups %s --nic net-id=%s  %s",
flavor,image,key,securityGroups,network)
p = Runtime.getRuntime().exec(command);
p.waitFor();
2015-07-28 12:54:48 -0500 received badge  Popular Question (source)
2015-07-10 09:56:06 -0500 received badge  Editor (source)
2015-07-10 09:50:03 -0500 asked a question How to display a date sorted list of images with date field

I've written this batch file to list images by date, it runs slow and relies on the gnu unix utilities. I was wondering if there was a faster way to do this


@echo off
rem  batch file # ==========================================================
rem  Name...........: getimagebyage.bat
rem  Description ...: List images by age
rem  Parameters ....: 
rem     %1 -  filter
rem  Returns .......: 
rem  Author  .......:  Thomas Bodine
rem  Modified.......:
rem  Remarks .......:
rem ======================================================================
if not exist output md output
nova image-list > output/images.txt
set target=output/images.txt
if [%1] == [] goto :nofilter
  grep -i %1  output/images.txt > output/imageFiltered.txt
  set target=output/imageFiltered.txt
:nofilter
cut -c42-98 %target% > output/imageNames.txt
C:\Windows\System32\find.exe /v "-----" output/imageNames.txt > output/justNames.txt 2> NUL:
del /q output\imageage.txt
for /f "tokens=*" %%A in (output\justNames.txt) do call :getage %%A  
sort output/imageage.txt > output/sortedImageAge.txt
start "" C:\Windows\System32\notepad.exe output/sortedImageAge.txt
goto :EOF
:getage
  rem echo on
  if [%1]==[] goto :EOF
  if [%1]==[----------] goto :EOF
  if [%1]==[Name] goto :EOF
  set imageName=%*
  glance image-show "%imageName%" > output\imageinfo.txt
  perl -n -e "print $1,'  ',""%imageName%\r\n"" if (/updated.*(\s\d\d\S+)/)" output\imageinfo.txt
  perl -n -e "print $1,'  ',""%imageName%\r\n"" if (/updated.*(\s\d\d\S+)/)" output\imageinfo.txt >> output\imageage.txt
  @echo off
goto :EOF
:EOF



Thanks for your time and attention.
2015-03-05 07:31:36 -0500 commented answer Windows 7 Console Unicode errors

Looks like someone put the N'ko alphabet Fa into the output stream for glance image-list

2015-03-04 08:46:37 -0500 answered a question Windows 7 Console Unicode errors

So I was thinking maybe if I changed the code page to something which hopefully has a mapping for u2013 I could solve my problem. So I tried 28591 ( ISO 8859-1) which I got from Code page List but according to this page Windows Code Pages It is actually 1252. So I ran the command to change the code page and the openstack command suddenly started working!


C:\Users\tbodine\Documents\CiscoStuff\Python>chcp 1252
Active code page: 1252

C:\Users\tbodine\Documents\CiscoStuff\Python>glance image-list
+--------------------------------------+----------------------------------------
-------------+-------------+------------------+--------------+--------+
| ID                                   | Name
             | Disk Format | Container Format | Size         | Status |
+--------------------------------------+----------------------------------------
-------------+-------------+------------------+--------------+--------+
| 1cd2e5a8-4f8d-4548-9d0c-61...
2015-03-04 07:38:36 -0500 received badge  Notable Question (source)
2015-03-02 13:27:44 -0500 commented answer Windows 7 Console Unicode errors

Mine is the same: C:\Users\tbodine>systeminfo.exe | findstr Locale

System Locale: en-us;English (United States)

Input Locale: en-us;English (United States)

2015-03-02 08:15:03 -0500 received badge  Popular Question (source)
2015-02-27 18:00:40 -0500 received badge  Student (source)
2015-02-27 14:44:50 -0500 asked a question Windows 7 Console Unicode errors

when I try to run glance from the command prompt in windows 7 I get this error. Is there a work around?

>echo %OS%
Windows_NT
>glance image-list
 'charmap' codec can't encode character u'\u2013' in position 976: character maps to <undefined>